summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@cardoe.com>2013-11-18 16:16:23 -0600
committerDaniel P. Berrange <berrange@redhat.com>2013-11-22 15:58:06 +0000
commit3878fbd548e7a0c9add168cadb814a1afa882667 (patch)
treecaa06a236a48e96afb9166c68e1a5a00dfe1207f
parent41562e063e33232111d17d3769ae4d58266a3b56 (diff)
downloadlibvirt-python-v9-3878fbd548e7a0c9add168cadb814a1afa882667.zip
libvirt-python-v9-3878fbd548e7a0c9add168cadb814a1afa882667.tar.gz
libvirt-python-v9-3878fbd548e7a0c9add168cadb814a1afa882667.tar.xz
Break generator.py to be called per module
Since we don't always want to build all the modules, and there might be more modules added in the future but we want to retain backwards compatibility with older libvirts, change generator.py to be called once per module instead of with all modules at once.
-rwxr-xr-xgenerator.py24
-rw-r--r--setup.py4
2 files changed, 15 insertions, 13 deletions
diff --git a/generator.py b/generator.py
index 9ea29a8..1d8f8f3 100755
--- a/generator.py
+++ b/generator.py
@@ -17,11 +17,6 @@ import re
quiet=True
-coreapifile = sys.argv[1]
-lxcapifile = sys.argv[2]
-qemuapifile = sys.argv[3]
-
-
#######################################################################
#
# That part if purely the API acquisition phase from the
@@ -1945,13 +1940,18 @@ def lxcBuildWrappers(module):
quiet = 0
if not os.path.exists("build"):
os.mkdir("build")
-if buildStubs("libvirt", coreapifile) < 0:
- sys.exit(1)
-if buildStubs("libvirt-lxc", lxcapifile) < 0:
+
+if buildStubs(sys.argv[1], sys.argv[2]) < 0:
sys.exit(1)
-if buildStubs("libvirt-qemu", qemuapifile) < 0:
+
+if sys.argv[1] == "libvirt":
+ buildWrappers(sys.argv[1])
+elif sys.argv[1] == "libvirt-lxc":
+ lxcBuildWrappers(sys.argv[1])
+elif sys.argv[1] == "libvirt-qemu":
+ qemuBuildWrappers(sys.argv[1])
+else:
+ print "ERROR: unknown module %s" % sys.argv[1]
sys.exit(1)
-buildWrappers("libvirt")
-lxcBuildWrappers("libvirt-lxc")
-qemuBuildWrappers("libvirt-qemu")
+
sys.exit(0)
diff --git a/setup.py b/setup.py
index 4de9489..5b72b09 100644
--- a/setup.py
+++ b/setup.py
@@ -100,7 +100,9 @@ class my_build(build):
def run(self):
apis = self.get_api_xml_files()
- self.spawn(["python", "generator.py", apis[0], apis[1], apis[2]])
+ self.spawn(["python", "generator.py", "libvirt", apis[0]])
+ self.spawn(["python", "generator.py", "libvirt-qemu", apis[1]])
+ self.spawn(["python", "generator.py", "libvirt-lxc", apis[2]])
build.run(self)