Hello community,

here is the log from the commit of package libvirt-python for openSUSE:Factory 
checked in at 2015-07-14 17:43:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libvirt-python (Old)
 and      /work/SRC/openSUSE:Factory/.libvirt-python.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libvirt-python"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libvirt-python/libvirt-python.changes    
2015-06-11 08:22:19.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libvirt-python.new/libvirt-python.changes       
2015-07-14 17:44:39.000000000 +0200
@@ -1,0 +2,6 @@
+Thu Jul  2 16:58:01 MDT 2015 - [email protected]
+
+- Update to 1.2.17
+  - Add all new APIs and constants in libvirt 1.2.17
+
+-------------------------------------------------------------------

Old:
----
  libvirt-python-1.2.16.tar.gz
  libvirt-python-1.2.16.tar.gz.asc

New:
----
  libvirt-python-1.2.17.tar.gz
  libvirt-python-1.2.17.tar.gz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libvirt-python.spec ++++++
--- /var/tmp/diff_new_pack.xoa8wk/_old  2015-07-14 17:44:40.000000000 +0200
+++ /var/tmp/diff_new_pack.xoa8wk/_new  2015-07-14 17:44:40.000000000 +0200
@@ -18,7 +18,7 @@
 
 Name:           libvirt-python
 Url:            http://libvirt.org/
-Version:        1.2.16
+Version:        1.2.17
 Release:        0
 Summary:        Library providing a simple virtualization API
 License:        LGPL-2.1+

++++++ libvirt-python-1.2.16.tar.gz -> libvirt-python-1.2.17.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/AUTHORS 
new/libvirt-python-1.2.17/AUTHORS
--- old/libvirt-python-1.2.16/AUTHORS   2015-06-01 04:44:46.000000000 +0200
+++ new/libvirt-python-1.2.17/AUTHORS   2015-07-02 07:33:52.000000000 +0200
@@ -56,6 +56,7 @@
    Nikunj A. Dadhania <[email protected]>
    Osier Yang <[email protected]>
    Oskari Saarenmaa <[email protected]>
+   Pavel Boldin <[email protected]>
    Pavel Hrdina <[email protected]>
    Peter Krempa <[email protected]>
    Philipp Hahn <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/ChangeLog 
new/libvirt-python-1.2.17/ChangeLog
--- old/libvirt-python-1.2.16/ChangeLog 2015-06-01 04:44:46.000000000 +0200
+++ new/libvirt-python-1.2.17/ChangeLog 2015-07-02 07:33:52.000000000 +0200
@@ -1,3 +1,48 @@
+2015-06-29 Pavel Boldin  <[email protected]>
+    
+    virPyDictToTypedParams: packing lists of values
+    Pack a list or a tuple of values passed to a Python method to the
+    multi-value parameter.
+    
+    
+2015-06-28 Martin Kletzander  <[email protected]>
+    
+    Revert "Change livbirt version to 1.3.0 for the next release"
+    This reverts commit 751e016f09a6a0dd372667bdd2b322731718e359.
+    
+    Since Admin API was deferred for a release and the minor version bump
+    didn't happen, it must not happen in libvirt-python either, for
+    compatibility reasons.
+    
+    
+2015-06-16 Martin Kletzander  <[email protected]>
+    
+    Change livbirt version to 1.3.0 for the next release
+    Since the background for Admin API is merged upstream, we are bumping
+    the minor release version as discussed previously
+    
+    
+    
+2015-06-08 Jiri Denemark  <[email protected]>
+    
+    Provide symbolic names for typed parameters
+    https://bugzilla.redhat.com/show_bug.cgi?id=1222795
+    
+    
+    
+2015-06-05 Jiri Denemark  <[email protected]>
+    
+    Post-release version bump to 1.2.17
+    
+    
+2015-06-01 Daniel P. Berrange  <[email protected]>
+    
+    Include tests in MANIFEST
+    The unit tests were missing from the tar.gz archives due to not
+    being listed in the MANIFEST.in file
+    
+    
+    
 2015-05-28 Jim Fehlig  <[email protected]>
     
     Fix duplicate entries in AUTHORS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/PKG-INFO 
new/libvirt-python-1.2.17/PKG-INFO
--- old/libvirt-python-1.2.16/PKG-INFO  2015-06-01 04:44:46.000000000 +0200
+++ new/libvirt-python-1.2.17/PKG-INFO  2015-07-02 07:33:52.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: libvirt-python
-Version: 1.2.16
+Version: 1.2.17
 Summary: The libvirt virtualization API
 Home-page: http://www.libvirt.org
 Author: Libvirt Maintainers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/generator.py 
new/libvirt-python-1.2.17/generator.py
--- old/libvirt-python-1.2.16/generator.py      2015-06-01 04:29:42.000000000 
+0200
+++ new/libvirt-python-1.2.17/generator.py      2015-07-02 07:32:19.000000000 
+0200
@@ -10,6 +10,7 @@
 lxc_enums = {} # { enumType: { enumConstant: enumValue } }
 qemu_enums = {} # { enumType: { enumConstant: enumValue } }
 event_ids = []
+params = [] # [ (parameName, paramValue)... ]
 
 import os
 import sys
@@ -134,6 +135,9 @@
                 lxc_enum(attrs['type'],attrs['name'],attrs['value'])
             elif attrs['file'] == "libvirt-qemu":
                 qemu_enum(attrs['type'],attrs['name'],attrs['value'])
+        elif tag == "macro":
+            if "string" in attrs:
+                params.append((attrs['name'], attrs['string']))
 
     def end(self, tag):
         if debug:
@@ -1881,6 +1885,10 @@
             classes.write("%s = %s\n" % (name,value))
         classes.write("\n")
 
+    classes.write("# typed parameter names\n")
+    for name, value in params:
+        classes.write("%s = \"%s\"\n" % (name, value))
+
     classes.close()
 
 def qemuBuildWrappers(module):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/libvirt-override.c 
new/libvirt-python-1.2.17/libvirt-override.c
--- old/libvirt-python-1.2.16/libvirt-override.c        2015-05-04 
05:28:00.000000000 +0200
+++ new/libvirt-python-1.2.17/libvirt-override.c        2015-07-02 
07:32:19.000000000 +0200
@@ -278,6 +278,126 @@
 #  define libvirt_PyString_Check PyString_Check
 # endif
 
+static int
+virPyDictToTypedParamOne(virTypedParameterPtr *params,
+                         int *n,
+                         int *max,
+                         virPyTypedParamsHintPtr hints,
+                         int nhints,
+                         const char *keystr,
+                         PyObject *value)
+{
+    int rv = -1, type = -1;
+    size_t i;
+
+    for (i = 0; i < nhints; i++) {
+        if (STREQ(hints[i].name, keystr)) {
+            type = hints[i].type;
+            break;
+        }
+    }
+
+    if (type == -1) {
+        if (libvirt_PyString_Check(value)) {
+            type = VIR_TYPED_PARAM_STRING;
+        } else if (PyBool_Check(value)) {
+            type = VIR_TYPED_PARAM_BOOLEAN;
+        } else if (PyLong_Check(value)) {
+            unsigned long long ull = PyLong_AsUnsignedLongLong(value);
+            if (ull == (unsigned long long) -1 && PyErr_Occurred())
+                type = VIR_TYPED_PARAM_LLONG;
+            else
+                type = VIR_TYPED_PARAM_ULLONG;
+#if PY_MAJOR_VERSION < 3
+        } else if (PyInt_Check(value)) {
+            if (PyInt_AS_LONG(value) < 0)
+                type = VIR_TYPED_PARAM_LLONG;
+            else
+                type = VIR_TYPED_PARAM_ULLONG;
+#endif
+        } else if (PyFloat_Check(value)) {
+            type = VIR_TYPED_PARAM_DOUBLE;
+        }
+    }
+
+    if (type == -1) {
+        PyErr_Format(PyExc_TypeError,
+                     "Unknown type of \"%s\" field", keystr);
+        goto cleanup;
+    }
+
+    switch ((virTypedParameterType) type) {
+    case VIR_TYPED_PARAM_INT:
+    {
+        int val;
+        if (libvirt_intUnwrap(value, &val) < 0 ||
+            virTypedParamsAddInt(params, n, max, keystr, val) < 0)
+            goto cleanup;
+        break;
+    }
+    case VIR_TYPED_PARAM_UINT:
+    {
+        unsigned int val;
+        if (libvirt_uintUnwrap(value, &val) < 0 ||
+            virTypedParamsAddUInt(params, n, max, keystr, val) < 0)
+            goto cleanup;
+        break;
+    }
+    case VIR_TYPED_PARAM_LLONG:
+    {
+        long long val;
+        if (libvirt_longlongUnwrap(value, &val) < 0 ||
+            virTypedParamsAddLLong(params, n, max, keystr, val) < 0)
+            goto cleanup;
+        break;
+    }
+    case VIR_TYPED_PARAM_ULLONG:
+    {
+        unsigned long long val;
+        if (libvirt_ulonglongUnwrap(value, &val) < 0 ||
+            virTypedParamsAddULLong(params, n, max, keystr, val) < 0)
+            goto cleanup;
+        break;
+    }
+    case VIR_TYPED_PARAM_DOUBLE:
+    {
+        double val;
+        if (libvirt_doubleUnwrap(value, &val) < 0 ||
+            virTypedParamsAddDouble(params, n, max, keystr, val) < 0)
+            goto cleanup;
+        break;
+    }
+    case VIR_TYPED_PARAM_BOOLEAN:
+    {
+        bool val;
+        if (libvirt_boolUnwrap(value, &val) < 0 ||
+            virTypedParamsAddBoolean(params, n, max, keystr, val) < 0)
+            goto cleanup;
+        break;
+    }
+    case VIR_TYPED_PARAM_STRING:
+    {
+        char *val;;
+        if (libvirt_charPtrUnwrap(value, &val) < 0 ||
+            !val ||
+            virTypedParamsAddString(params, n, max, keystr, val) < 0) {
+            VIR_FREE(val);
+            goto cleanup;
+        }
+        VIR_FREE(val);
+        break;
+    }
+    case VIR_TYPED_PARAM_LAST:
+        break; /* unreachable */
+    }
+
+    rv = 0;
+
+ cleanup:
+    return rv;
+}
+
+
 /* Automatically convert dict into type parameters based on types reported
  * by python. All integer types are converted into LLONG (in case of a negative
  * value) or ULLONG (in case of a positive value). If you need different
@@ -300,7 +420,6 @@
     Py_ssize_t pos = 0;
 #endif
     virTypedParameterPtr params = NULL;
-    size_t i;
     int n = 0;
     int max = 0;
     int ret = -1;
@@ -313,112 +432,23 @@
         return -1;
 
     while (PyDict_Next(dict, &pos, &key, &value)) {
-        int type = -1;
-
         if (libvirt_charPtrUnwrap(key, &keystr) < 0 ||
             !keystr)
             goto cleanup;
 
-        for (i = 0; i < nhints; i++) {
-            if (STREQ(hints[i].name, keystr)) {
-                type = hints[i].type;
-                break;
-            }
-        }
+        if (PyList_Check(value) || PyTuple_Check(value)) {
+            Py_ssize_t i, size = PySequence_Size(value);
 
-        if (type == -1) {
-            if (libvirt_PyString_Check(value)) {
-                type = VIR_TYPED_PARAM_STRING;
-            } else if (PyBool_Check(value)) {
-                type = VIR_TYPED_PARAM_BOOLEAN;
-            } else if (PyLong_Check(value)) {
-                unsigned long long ull = PyLong_AsUnsignedLongLong(value);
-                if (ull == (unsigned long long) -1 && PyErr_Occurred())
-                    type = VIR_TYPED_PARAM_LLONG;
-                else
-                    type = VIR_TYPED_PARAM_ULLONG;
-#if PY_MAJOR_VERSION < 3
-            } else if (PyInt_Check(value)) {
-                if (PyInt_AS_LONG(value) < 0)
-                    type = VIR_TYPED_PARAM_LLONG;
-                else
-                    type = VIR_TYPED_PARAM_ULLONG;
-#endif
-            } else if (PyFloat_Check(value)) {
-                type = VIR_TYPED_PARAM_DOUBLE;
+            for (i = 0; i < size; i++) {
+                PyObject *v = PySequence_ITEM(value, i);
+                if (virPyDictToTypedParamOne(&params, &n, &max,
+                                             hints, nhints, keystr, v) < 0)
+                    goto cleanup;
             }
-        }
-
-        if (type == -1) {
-            PyErr_Format(PyExc_TypeError,
-                         "Unknown type of \"%s\" field", keystr);
+        } else if (virPyDictToTypedParamOne(&params, &n, &max,
+                                            hints, nhints, keystr, value) < 0)
             goto cleanup;
-        }
 
-        switch ((virTypedParameterType) type) {
-        case VIR_TYPED_PARAM_INT:
-        {
-            int val;
-            if (libvirt_intUnwrap(value, &val) < 0 ||
-                virTypedParamsAddInt(&params, &n, &max, keystr, val) < 0)
-                goto cleanup;
-            break;
-        }
-        case VIR_TYPED_PARAM_UINT:
-        {
-            unsigned int val;
-            if (libvirt_uintUnwrap(value, &val) < 0 ||
-                virTypedParamsAddUInt(&params, &n, &max, keystr, val) < 0)
-                goto cleanup;
-            break;
-        }
-        case VIR_TYPED_PARAM_LLONG:
-        {
-            long long val;
-            if (libvirt_longlongUnwrap(value, &val) < 0 ||
-                virTypedParamsAddLLong(&params, &n, &max, keystr, val) < 0)
-                goto cleanup;
-            break;
-        }
-        case VIR_TYPED_PARAM_ULLONG:
-        {
-            unsigned long long val;
-            if (libvirt_ulonglongUnwrap(value, &val) < 0 ||
-                virTypedParamsAddULLong(&params, &n, &max, keystr, val) < 0)
-                goto cleanup;
-            break;
-        }
-        case VIR_TYPED_PARAM_DOUBLE:
-        {
-            double val;
-            if (libvirt_doubleUnwrap(value, &val) < 0 ||
-                virTypedParamsAddDouble(&params, &n, &max, keystr, val) < 0)
-                goto cleanup;
-            break;
-        }
-        case VIR_TYPED_PARAM_BOOLEAN:
-        {
-            bool val;
-            if (libvirt_boolUnwrap(value, &val) < 0 ||
-                virTypedParamsAddBoolean(&params, &n, &max, keystr, val) < 0)
-                goto cleanup;
-            break;
-        }
-        case VIR_TYPED_PARAM_STRING:
-        {
-            char *val;;
-            if (libvirt_charPtrUnwrap(value, &val) < 0 ||
-                !val ||
-                virTypedParamsAddString(&params, &n, &max, keystr, val) < 0) {
-                VIR_FREE(val);
-                goto cleanup;
-            }
-            VIR_FREE(val);
-            break;
-        }
-        case VIR_TYPED_PARAM_LAST:
-            break; /* unreachable */
-        }
         VIR_FREE(keystr);
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/libvirt-python.spec 
new/libvirt-python-1.2.17/libvirt-python.spec
--- old/libvirt-python-1.2.16/libvirt-python.spec       2015-06-01 
04:44:46.000000000 +0200
+++ new/libvirt-python-1.2.17/libvirt-python.spec       2015-07-02 
07:33:52.000000000 +0200
@@ -6,7 +6,7 @@
 
 Summary: The libvirt virtualization API python2 binding
 Name: libvirt-python
-Version: 1.2.16
+Version: 1.2.17
 Release: 1%{?dist}%{?extra_release}
 Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
 Url: http://libvirt.org
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/setup.py 
new/libvirt-python-1.2.17/setup.py
--- old/libvirt-python-1.2.16/setup.py  2015-06-01 04:29:42.000000000 +0200
+++ new/libvirt-python-1.2.17/setup.py  2015-07-02 07:32:19.000000000 +0200
@@ -311,7 +311,7 @@
 _c_modules, _py_modules = get_module_lists()
 
 setup(name = 'libvirt-python',
-      version = '1.2.16',
+      version = '1.2.17',
       url = 'http://www.libvirt.org',
       maintainer = 'Libvirt Maintainers',
       maintainer_email = '[email protected]',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/tests/test_conn.py 
new/libvirt-python-1.2.17/tests/test_conn.py
--- old/libvirt-python-1.2.16/tests/test_conn.py        1970-01-01 
01:00:00.000000000 +0100
+++ new/libvirt-python-1.2.17/tests/test_conn.py        2014-03-29 
14:15:37.000000000 +0100
@@ -0,0 +1,16 @@
+
+import unittest
+import libvirt
+
+class TestLibvirtConn(unittest.TestCase):
+    def setUp(self):
+        self.conn = libvirt.open("test:///default")
+
+    def tearDown(self):
+        self.conn = None
+
+    def testConnDomainList(self):
+        doms = self.conn.listAllDomains()
+        self.assertEquals(len(doms), 1)
+        self.assertEquals(type(doms[0]), libvirt.virDomain)
+        self.assertEquals(doms[0].name(), "test")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libvirt-python-1.2.16/tests/test_domain.py 
new/libvirt-python-1.2.17/tests/test_domain.py
--- old/libvirt-python-1.2.16/tests/test_domain.py      1970-01-01 
01:00:00.000000000 +0100
+++ new/libvirt-python-1.2.17/tests/test_domain.py      2014-03-29 
14:15:37.000000000 +0100
@@ -0,0 +1,19 @@
+
+import unittest
+import libvirt
+
+class TestLibvirtDomain(unittest.TestCase):
+    def setUp(self):
+        self.conn = libvirt.open("test:///default")
+        self.dom = self.conn.lookupByName("test")
+
+    def tearDown(self):
+        self.dom = None
+        self.conn = None
+
+    def testDomainSchedParams(self):
+        params = self.dom.schedulerParameters()
+        self.assertEquals(len(params), 1)
+        self.assertTrue("weight" in params)
+        params["weight"] = 100
+        self.dom.setSchedulerParameters(params)


Reply via email to