slipstream / SlipStreamClient

SlipStream Python client
Apache License 2.0
1 stars 4 forks source link

when deploying SS with SS ss-* deployment commands pick up the client libs from site-packages #376

Open konstan opened 6 years ago

konstan commented 6 years ago

When deploying SS with SS ss-* deployment commands pick up the client libs from site-packages, and may fail when changes are made to slipstream-client on master, while the deployment from SS (e.g. Nuvla) provides different version of SS client. This leads to the need of forcing the SS client to first be search under /opt/slipstream/client/lib/.

Failure of the deployment of SS with SS from /var/log/slipstream/client/slipstream-node.log

+ ss-set ss_users super:xxx,test:xxx
Traceback (most recent call last):
  File "/opt/slipstream/client/bin/ss-set", line 67, in <module>
    MainProgram()
  File "/opt/slipstream/client/bin/ss-set", line 35, in __init__
    super(MainProgram, self).__init__(argv)
  File "/usr/lib/python2.7/site-packages/slipstream/command/VMCommandBase.py", line 27, in __init__
    super(VMCommandBase, self).__init__(argv)
  File "/usr/lib/python2.7/site-packages/slipstream/command/CommandBase.py", line 79, in __init__
    self._setParserAndParse()
  File "/usr/lib/python2.7/site-packages/slipstream/command/CommandBase.py", line 98, in _setParserAndParse
    self.parse()
  File "/opt/slipstream/client/bin/ss-set", line 52, in parse
    self.add_run_authn_opts_and_parse()
AttributeError: 'MainProgram' object has no attribute 'add_run_authn_opts_and_parse'

Below is the change that was introduced.

[root@machinedeee75a7-5d8d-4fa0-b83e-a375a93d4fa2 ~]# locate VMCommandBase.py
/opt/slipstream/client/lib/slipstream/command/VMCommandBase.py
/usr/lib/python2.7/site-packages/slipstream/command/VMCommandBase.py
[root@machinedeee75a7-5d8d-4fa0-b83e-a375a93d4fa2 ~]# diff /usr/lib/python2.7/site-packages/slipstream/command/VMCommandBase.py /opt/slipstream/client/lib/slipstream/command/VMCommandBase.py
29c29
<     def add_run_opts_and_parse(self):
---
>     def add_run_authn_opts_and_parse(self):
32a33
>         self.add_authentication_options()
[root@machinedeee75a7-5d8d-4fa0-b83e-a375a93d4fa2 ~]# which ss-set
/usr/bin/ss-set
[root@machinedeee75a7-5d8d-4fa0-b83e-a375a93d4fa2 ~]# rpm -qf `which ss-set`
slipstream-client-3.44-1278.el7.noarch
[root@machinedeee75a7-5d8d-4fa0-b83e-a375a93d4fa2 ~]#