juju / charmstore-client

Client for charmstore.
Other
9 stars 22 forks source link

charmstore-client snap: charm test fails due to executing juju --version #108

Open dshcherb opened 7 years ago

dshcherb commented 7 years ago

charm test fails:

snap list
Name   Version  Rev  Developer  Notes
charm  2.2      9    charms     -

juju --version
2.0.2-xenial-amd64

charm test
Traceback (most recent call last):
  File "/snap/charm/9/bin/charm-test", line 11, in <module>
    sys.exit(main())
  File "/snap/charm/9/lib/python2.7/site-packages/charmtools/test.py", line 679, in main
    % (args.juju_env, get_juju_version()))
  File "/snap/charm/9/lib/python2.7/site-packages/charmtools/test.py", line 449, in get_juju_version
    version = subprocess.check_output(cmd)
  File "/snap/charm/9/usr/lib/python2.7/subprocess.py", line 567, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/snap/charm/9/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/snap/charm/9/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

A strace reveals that the snap uses its modified PATH to execute a non-existing juju binary. It would not be able to use the needed binary anyway due to confinement.

[pid   919] execve("/snap/charm/9/usr/sbin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/snap/charm/9/usr/bin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/snap/charm/9/sbin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/snap/charm/9/bin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/usr/sbin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/usr/bin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/sbin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/bin/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
[pid   919] execve("/usr/games/juju", ["juju", "--version"], [/* 43 vars */]) = -1 ENOENT (No such file or directory)
jrwren commented 7 years ago
juju --version
2.0.2-xenial-amd64

Is this juju installed via snap? What is the output of which juju? Either way, it should probably be updated to search /snap/bin for a juju binary.