[ovirt-users] ovirt shell on mac OS ?
Juan Hernández
jhernand at redhat.com
Thu Aug 20 14:41:00 UTC 2015
On 08/20/2015 04:32 PM, Fabrice Bacchella wrote:
>
>> Le 20 août 2015 à 16:03, Juan Hernández <jhernand at 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 at 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.
More information about the Users
mailing list