Skip to content

Commit 1a996e5

Browse files
committed
cue: fix erroneous entries in /etc/hosts on Travis
1 parent f927e47 commit 1a996e5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cue.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,21 @@ def setup_for_build(args):
644644
extra_makeargs.append(os.environ[tag])
645645

646646

647+
def fix_etc_hosts():
648+
# Several travis-ci images throw us a curveball in /etc/hosts
649+
# by including two entries for localhost. The first for 127.0.1.1
650+
# causes epicsSockResolveTest to fail.
651+
# cat /etc/hosts
652+
# ...
653+
# 127.0.1.1 localhost localhost ip4-loopback
654+
# 127.0.0.1 localhost nettuno travis vagrant travis-job-....
655+
656+
logger.debug("EXEC sudo sed -ie '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts")
657+
sys.stdout.flush()
658+
exitcode = sp.call(['sudo', 'sed', '-ie', '/^127\.0\.1\.1/ s|localhost\s*||g', '/etc/hosts'])
659+
logger.debug('EXEC DONE')
660+
661+
647662
def prepare(args):
648663
host_info()
649664

@@ -664,6 +679,9 @@ def prepare(args):
664679

665680
logger.debug('Effective module list: %s', modlist())
666681

682+
if ci['service'] == 'travis' and ci['os'] == 'linux':
683+
fix_etc_hosts()
684+
667685
# we're working with tags (detached heads) a lot: suppress advice
668686
call_git(['config', '--global', 'advice.detachedHead', 'false'])
669687

0 commit comments

Comments
 (0)