[libvirt] [test-API][PATCH 2/2] Add optional argument uuid in create and install module

Wayne Sun gsun at redhat.com
Fri Oct 14 10:34:13 UTC 2011


---
 repos/domain/create.py                |    6 ++++--
 repos/domain/install_image.py         |    5 +++--
 repos/domain/install_linux_cdrom.py   |   12 +++++++-----
 repos/domain/install_linux_net.py     |   13 ++++++++-----
 repos/domain/install_windows_cdrom.py |   12 +++++++-----
 5 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/repos/domain/create.py b/repos/domain/create.py
index a06a2d3..b6e1e66 100644
--- a/repos/domain/create.py
+++ b/repos/domain/create.py
@@ -3,7 +3,8 @@
    create domain from xml
    mandatory arguments:guesttype
                        guestname
-   optional arguments: memory
+   optional arguments: uuid
+                       memory
                        vcpu
                        disksize
                        imagepath
@@ -49,7 +50,8 @@ START_PAUSED = 1
 def usage():
     print '''usage: mandatory arguments:guesttype
                            guestname
-       optional arguments: memory
+       optional arguments: uuid
+                           memory
                            vcpu
                            disksize
                            imagepath
diff --git a/repos/domain/install_image.py b/repos/domain/install_image.py
index 3fb8970..888e80f 100644
--- a/repos/domain/install_image.py
+++ b/repos/domain/install_image.py
@@ -5,7 +5,8 @@
                        guestname
                        guestos
                        guestarch
-   optional arguments: memory
+   optional arguments: uuid
+                       memory
                        vcpu
                        imagepath
                        imagetype
@@ -54,7 +55,7 @@ def check_params(params):
     """Checking the arguments required"""
     params_given = copy.deepcopy(params)
     mandatory_args = ['guestname', 'guesttype', 'guestos', 'guestarch']
-    optional_args = ['memory', 'vcpu', 'imagepath', 'imagetype',
+    optional_args = ['uuid', 'memory', 'vcpu', 'imagepath', 'imagetype',
                      'hdmodel', 'nicmodel']
 
     for arg in mandatory_args:
diff --git a/repos/domain/install_linux_cdrom.py b/repos/domain/install_linux_cdrom.py
index 8d21797..79dd41c 100644
--- a/repos/domain/install_linux_cdrom.py
+++ b/repos/domain/install_linux_cdrom.py
@@ -5,7 +5,8 @@
                        guestname
                        guestos
                        guestarch
-   optional arguments: memory
+   optional arguments: uuid
+                       memory
                        vcpu
                        disksize
                        imagetype
@@ -68,7 +69,8 @@ def return_close(conn, logger, ret):
 def usage():
     print '''usage: mandatory arguments:guesttype
                            guestname
-       optional arguments: memory
+       optional arguments: uuid
+                           memory
                            vcpu
                            disksize
                            imagetype
@@ -86,9 +88,9 @@ def check_params(params):
     """Checking the arguments required"""
     params_given = copy.deepcopy(params)
     mandatory_args = ['guestname', 'guesttype', 'guestos', 'guestarch']
-    optional_args = ['memory', 'vcpu', 'disksize', 'imagepath', 'hdmodel',
-                     'nicmodel', 'macaddr', 'ifacetype', 'source', 'type',
-                     'volumepath', 'imagetype']
+    optional_args = ['uuid', 'memory', 'vcpu', 'disksize', 'imagepath',
+                     'hdmodel', 'nicmodel', 'macaddr', 'ifacetype', 'source',
+                     'type', 'volumepath', 'imagetype']
 
     for arg in mandatory_args:
         if arg not in params_given.keys():
diff --git a/repos/domain/install_linux_net.py b/repos/domain/install_linux_net.py
index 1b0470e..0ef5036 100644
--- a/repos/domain/install_linux_net.py
+++ b/repos/domain/install_linux_net.py
@@ -6,7 +6,8 @@
                        guestos
                        guestarch
                        netmethod
-   optional arguments: memory
+   optional arguments: uuid
+                       memory
                        vcpu
                        disksize
                        imagetype
@@ -70,7 +71,8 @@ def usage():
                            guestos
                            guestarch
                            netmethod
-       optional arguments: memory
+       optional arguments: uuid
+                           memory
                            vcpu
                            disksize
                            imagetype
@@ -89,9 +91,10 @@ def check_params(params):
     mandatory_args = ['guestname', 'guesttype', 'guestos',
                       'guestarch','netmethod']
 
-    optional_args = ['memory', 'vcpu', 'disksize', 'imagepath',
-                     'hdmodel', 'nicmodel', 'ifacetype',
-                     'imagetype', 'source', 'type']
+    optional_args = ['uuid', 'memory', 'vcpu', 'disksize',
+                     'imagepath', 'hdmodel', 'nicmodel',
+                     'ifacetype', 'imagetype', 'source',
+                     'type']
 
     for arg in mandatory_args:
         if arg not in params_given.keys():
diff --git a/repos/domain/install_windows_cdrom.py b/repos/domain/install_windows_cdrom.py
index b8333e2..79cd25c 100644
--- a/repos/domain/install_windows_cdrom.py
+++ b/repos/domain/install_windows_cdrom.py
@@ -5,7 +5,8 @@
                        guestname
                        guestos
                        guestarch
-   optional arguments: memory
+   optional arguments: uuid
+                       memory
                        vcpu
                        disksize
                        imagetype
@@ -66,7 +67,8 @@ def usage():
                            guestname
                            guestos
                            guestarch
-       optional arguments: memory
+       optional arguments: uuid
+                           memory
                            vcpu
                            disksize
                            imagetype
@@ -89,9 +91,9 @@ def check_params(params):
     """Checking the arguments required"""
     params_given = copy.deepcopy(params)
     mandatory_args = ['guestname', 'guesttype', 'guestos', 'guestarch']
-    optional_args = ['memory', 'vcpu', 'disksize', 'imagepath', 'hdmodel',
-                     'nicmodel', 'macaddr', 'ifacetype', 'source', 'type',
-                     'volumepath', 'imagetype']
+    optional_args = ['uuid', 'memory', 'vcpu', 'disksize', 'imagepath',
+                     'hdmodel', 'nicmodel', 'macaddr', 'ifacetype',
+                     'source', 'type', 'volumepath', 'imagetype']
 
     for arg in mandatory_args:
         if arg not in params_given.keys():
-- 
1.7.1




More information about the libvir-list mailing list