ovirt shell on mac OS ?

I'm trying to install ovirt-shell on my mac, as explained in http://www.ovirt.org/CLI#pypi , but if fails : $ virtualenv-2.7 ovirt New python executable in ovirt/bin/python Installing setuptools, pip, wheel...done. $ ./ovirt/bin/easy_install ovirt-shell Searching for ovirt-shell Reading https://pypi.python.org/simple/ovirt-shell/ Best match: ovirt-shell 3.5.0.6 ... Finished processing dependencies for ovirt-shell $ ./ovirt/bin/ovirt-shell Traceback (most recent call last): File "./ovirt/bin/ovirt-shell", line 9, in <module> load_entry_point('ovirt-shell==3.5.0.6', 'console_scripts', 'ovirt-shell')() File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 552, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2672, in load_entry_point return ep.load() File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2345, in load return self.resolve() File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2351, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "build/bdist.macosx-10.10-x86_64/egg/ovirtcli/main.py", line 19, in <module> File "build/bdist.macosx-10.10-x86_64/egg/ovirtcli/infrastructure/options.py", line 21, in <module> File "build/bdist.macosx-10.10-x86_64/egg/ovirtcli/infrastructure/settings.py", line 18, in <module> File "build/bdist.macosx-10.10-x86_64/egg/cli/__init__.py", line 3, in <module> File "build/bdist.macosx-10.10-x86_64/egg/cli/context.py", line 34, in <module> ImportError: cannot import name Terminal

On 08/20/2015 01:00 PM, Fabrice Bacchella wrote:
I'm trying to install ovirt-shell on my mac, as explained in http://www.ovirt.org/CLI#pypi , but if fails :
$ virtualenv-2.7 ovirt New python executable in ovirt/bin/python Installing setuptools, pip, wheel...done. $ ./ovirt/bin/easy_install ovirt-shell Searching for ovirt-shell Reading https://pypi.python.org/simple/ovirt-shell/ Best match: ovirt-shell 3.5.0.6 ... Finished processing dependencies for ovirt-shell
$ ./ovirt/bin/ovirt-shell Traceback (most recent call last): File "./ovirt/bin/ovirt-shell", line 9, in <module> load_entry_point('ovirt-shell==3.5.0.6', 'console_scripts', 'ovirt-shell')() File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 552, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2672, in load_entry_point return ep.load() File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2345, in load return self.resolve() File "/private/tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2351, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "build/bdist.macosx-10.10-x86_64/egg/ovirtcli/main.py", line 19, in <module> File "build/bdist.macosx-10.10-x86_64/egg/ovirtcli/infrastructure/options.py", line 21, in <module> File "build/bdist.macosx-10.10-x86_64/egg/ovirtcli/infrastructure/settings.py", line 18, in <module> File "build/bdist.macosx-10.10-x86_64/egg/cli/__init__.py", line 3, in <module> File "build/bdist.macosx-10.10-x86_64/egg/cli/context.py", line 34, in <module> ImportError: cannot import name Terminal
I have created the following bug to track this issue: https://bugzilla.redhat.com/1255409 Note that we (well, at least I) don't have any Mac OS environment to test this, so it is unlikely that we can add support for it. Would you be interested in working on this yourself? -- Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.

Le 20 août 2015 à 15:50, Juan Hernández <jhernand@redhat.com> a écrit :
On 08/20/2015 01:00 PM, Fabrice Bacchella wrote:
I'm trying to install ovirt-shell on my mac, as explained in http://www.ovirt.org/CLI#pypi , but if fails :
I have created the following bug to track this issue:
https://bugzilla.redhat.com/1255409
Note that we (well, at least I) don't have any Mac OS environment to test this, so it is unlikely that we can add support for it. Would you be interested in working on this yourself?
Yes, that's possible. I just need a little help about this Terminal thing. Is that a normal dependency ? Perhaps a simple modification to setup.py can help.

On 08/20/2015 03:52 PM, Fabrice Bacchella wrote:
Le 20 août 2015 à 15:50, Juan Hernández <jhernand@redhat.com> a écrit :
On 08/20/2015 01:00 PM, Fabrice Bacchella wrote:
I'm trying to install ovirt-shell on my mac, as explained in http://www.ovirt.org/CLI#pypi , but if fails :
I have created the following bug to track this issue:
https://bugzilla.redhat.com/1255409
Note that we (well, at least I) don't have any Mac OS environment to test this, so it is unlikely that we can add support for it. Would you be interested in working on this yourself?
Yes, that's possible. I just need a little help about this Terminal thing. Is that a normal dependency ? Perhaps a simple modification to setup.py can help.
This is related to the cli/platform/__init__.py, there we check what is the platform using the Python "sys.platform" variable. Currently we only check for "linux2" and "win32". I think that in Mac OS the value of "sys.platform" is "darwin". So, if you can, try to modify that file so that it has this content: import sys if sys.platform in ['linux2', 'darwin']: from cli.platform.posix.terminal import PosixTerminal as Terminal from cli.platform.posix.util import * elif sys.platform in ('win32',): pass Then check if it works correctly. -- Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.

On 08/20/2015 04:01 PM, Juan Hernández wrote:
On 08/20/2015 03:52 PM, Fabrice Bacchella wrote:
Le 20 août 2015 à 15:50, Juan Hernández <jhernand@redhat.com> a écrit :
On 08/20/2015 01:00 PM, Fabrice Bacchella wrote:
I'm trying to install ovirt-shell on my mac, as explained in http://www.ovirt.org/CLI#pypi , but if fails :
I have created the following bug to track this issue:
https://bugzilla.redhat.com/1255409
Note that we (well, at least I) don't have any Mac OS environment to test this, so it is unlikely that we can add support for it. Would you be interested in working on this yourself?
Yes, that's possible. I just need a little help about this Terminal thing. Is that a normal dependency ? Perhaps a simple modification to setup.py can help.
This is related to the cli/platform/__init__.py, there we check what is the platform using the Python "sys.platform" variable. Currently we only check for "linux2" and "win32". I think that in Mac OS the value of "sys.platform" is "darwin". So, if you can, try to modify that file so that it has this content:
import sys
if sys.platform in ['linux2', 'darwin']: from cli.platform.posix.terminal import PosixTerminal as Terminal from cli.platform.posix.util import *
elif sys.platform in ('win32',): pass
Then check if it works correctly.
The same happens in the following two files: src/ovirtcli/platform/__init__.py src/ovirtcli/platform/windows/__init__.py Please try the same modification, add "darwin" to the list that currently contains only "linux2" and test. -- Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.

Le 20 août 2015 à 16:03, Juan Hernández <jhernand@redhat.com> a écrit :
This is related to the cli/platform/__init__.py, there we check what is the platform using the Python "sys.platform" variable. Currently we only check for "linux2" and "win32". I think that in Mac OS the value of "sys.platform" is "darwin". So, if you can, try to modify that file so that it has this content:
import sys
if sys.platform in ['linux2', 'darwin']: from cli.platform.posix.terminal import PosixTerminal as Terminal from cli.platform.posix.util import *
elif sys.platform in ('win32',): pass
Then check if it works correctly.
yes ! But now I'm getting a lot of : [oVirt shell ([1;31mdisconnected[1;m)]# connect --url XXX --user admin@internal --password XXX --insecure WARNING: Couldn't write lextab module 'cli.parser_lex'. [Errno 20] Not a directory: '/tmp/ovirt/lib/python2.7/site-packages/ovirt_shell-3.5.0.6-py2.7.egg/cli/parser_lex.py' WARNING: Couldn't create 'cli.parser_tab'. [Errno 20] Not a directory: '/tmp/ovirt/lib/python2.7/site-packages/ovirt_shell-3.5.0.6-py2.7.egg/cli/parser_tab.py' /tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py:197: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need. stacklevel=1,

On 08/20/2015 04:32 PM, Fabrice Bacchella wrote:
Le 20 août 2015 à 16:03, Juan Hernández <jhernand@redhat.com> a écrit :
This is related to the cli/platform/__init__.py, there we check what is the platform using the Python "sys.platform" variable. Currently we only check for "linux2" and "win32". I think that in Mac OS the value of "sys.platform" is "darwin". So, if you can, try to modify that file so that it has this content:
import sys
if sys.platform in ['linux2', 'darwin']: from cli.platform.posix.terminal import PosixTerminal as Terminal from cli.platform.posix.util import *
elif sys.platform in ('win32',): pass
Then check if it works correctly.
yes ! But now I'm getting a lot of : [oVirt shell ([1;31mdisconnected[1;m)]# connect --url XXX --user admin@internal --password XXX --insecure WARNING: Couldn't write lextab module 'cli.parser_lex'. [Errno 20] Not a directory: '/tmp/ovirt/lib/python2.7/site-packages/ovirt_shell-3.5.0.6-py2.7.egg/cli/parser_lex.py' WARNING: Couldn't create 'cli.parser_tab'. [Errno 20] Not a directory: '/tmp/ovirt/lib/python2.7/site-packages/ovirt_shell-3.5.0.6-py2.7.egg/cli/parser_tab.py' /tmp/ovirt/lib/python2.7/site-packages/pkg_resources/__init__.py:197: RuntimeWarning: You have iterated over the result of pkg_resources.parse_version. This is a legacy behavior which is inconsistent with the new version class introduced in setuptools 8.0. In most cases, conversion to a tuple is unnecessary. For comparison of versions, sort the Version instances directly. If you have another use case requiring the tuple, please file a bug with the setuptools project describing that need. stacklevel=1,
OK. The warnings happen because the parser generator that we use is trying to write its parse tables during runtime, but it doesn't have permission because the files are probably owned by root. You can try to solve that running the following command as root: # python -c 'import cli.parser; parser = cli.parser.Parser(); parser._write_tables()' In platforms that use the RPM packaging system we run this when the package is installed. I need to check if we can move this to setup.py somehow. I'm not familiar with the pkg_resources.parse_version issue, will take a look. Other than those warnings, does it work? By the way, I'd appreciate if you can add these comments to the bug: https://bugzilla.redhat.com/1255409 You may need to create an account if you don't have one yet. -- Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 Madrid, Spain Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.
participants (2)
-
Fabrice Bacchella
-
Juan Hernández