[Engine-patches] Change in ovirt-engine-cli[master]: cli: Update to generateDS.py 2.12a

juan.hernandez at redhat.com juan.hernandez at redhat.com
Wed May 21 11:20:24 UTC 2014


Juan Hernandez has uploaded a new change for review.

Change subject: cli: Update to generateDS.py 2.12a
......................................................................

cli: Update to generateDS.py 2.12a

Starting with version 3.5.0.0 of the Python SDK the version of
generateDS.py used to generate the code will be 2.12.a. One of the
changes in this version of generateDS.py is that it doesn't import the
datetime class like it used to do. In version 2.9a it imported it as
follows:

  from from datetime import datetime, tzinfo, timedelta

In version 2.12a it imports it in a different way:

  import datetime as datetime_

We currently depend on the name used by the generated code, so the CLI
doesn't work with the new version of generateDS.py. To fix that problem
and avoid it in the future this patch changes the CLI so that it doesn't
depend on how generateDS.py imports the class.

In addition this patch also updates the setup.py and the RPM spec to
require version 3.5.0.0 of the Python SDK.

Change-Id: Ia1b1529e9428a0b90f914b582f12153c809bdc5b
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M ovirt-engine-cli.spec.in
M setup.py
M src/ovirtcli/format/text.py
3 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-cli refs/changes/69/27969/1

diff --git a/ovirt-engine-cli.spec.in b/ovirt-engine-cli.spec.in
index eac935a..ef5032e 100644
--- a/ovirt-engine-cli.spec.in
+++ b/ovirt-engine-cli.spec.in
@@ -15,7 +15,7 @@
 BuildArch: noarch
 
 Requires: python
-Requires: ovirt-engine-sdk-python >= 3.3.0.3
+Requires: ovirt-engine-sdk-python >= 3.5.0.0
 Requires: python-setuptools
 Requires: python-ply
 Requires: python-kitchen
diff --git a/setup.py b/setup.py
index 5c0c353..799e48d 100755
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@
                  'cli.command', 'cli.platform', 'cli.platform.posix', 'ovirtcli.infrastructure',
                  'ovirtcli.annotations', 'ovirtcli.events', 'ovirtcli.listeners', 'ovirtcli.meta',
                  'ovirtcli.state'],
-    install_requires=[ 'ovirt-engine-sdk-python >= 3.3.0.3', 'ply >= 3.3', 'kitchen >= 1' ],
+    install_requires=[ 'ovirt-engine-sdk-python >= 3.5.0.0', 'ply >= 3.3', 'kitchen >= 1' ],
     entry_points={ 'console_scripts': [ 'ovirt-shell = ovirtcli.main:main' ] },
     **version_info
 )
diff --git a/src/ovirtcli/format/text.py b/src/ovirtcli/format/text.py
index ade7390..28bf34d 100644
--- a/src/ovirtcli/format/text.py
+++ b/src/ovirtcli/format/text.py
@@ -15,6 +15,7 @@
 #
 
 
+import datetime
 import sys
 
 from ovirtcli.format.format import Formatter
@@ -48,7 +49,7 @@
 
     # list of complex types that should be treated as
     # primitives (e.g should be wrapped to string at runtime)
-    complex_type_exceptions = [params.datetime]
+    complex_type_exceptions = [datetime.datetime]
 
 
     def _get_fields(self, typ):


-- 
To view, visit http://gerrit.ovirt.org/27969
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1b1529e9428a0b90f914b582f12153c809bdc5b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>



More information about the Engine-patches mailing list