[node-patches] Change in ovirt-node[master]: app: Add dry param

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Dec 11 20:09:41 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: app: Add dry param
......................................................................

app: Add dry param

Change-Id: Ifbcba57f5505c21d8fcf5a6d06dcaa551e06377a
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/app.py
M scripts/tui/src/ovirt/node/config/defaults.py
2 files changed, 15 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/46/9946/1

diff --git a/scripts/tui/src/ovirt/node/app.py b/scripts/tui/src/ovirt/node/app.py
index 3bcc939..f2f9fb6 100644
--- a/scripts/tui/src/ovirt/node/app.py
+++ b/scripts/tui/src/ovirt/node/app.py
@@ -55,15 +55,19 @@
 
     def __parse_cmdline(self):
         parser = argparse.ArgumentParser(description='oVirt Node Utility')
-        parser.add_argument("--config",
+        parser.add_argument("--defaults",
                             type=str,
                             help="Central oVirt Node configuration file")
-        args = parser.parse_args()
-        self.logger.debug("Parsed args: %s" % args)
-        if args.config:
-            defaults.OVIRT_NODE_DEFAULTS_FILENAME = args.config
+        parser.add_argument("--dry",
+                            action='store_true',
+                            help="Just write defaults, nothing else")
+        self.args = parser.parse_args()
+        self.logger.debug("Parsed args: %s" % self.args)
+        if self.args.defaults:
+            # FIXME Should be read by clients
+            defaults.OVIRT_NODE_DEFAULTS_FILENAME = self.args.defaults
             self.logger.debug("Setting config file: %s (%s)" % (
-                                        args.config,
+                                        self.args.defaults,
                                         defaults.OVIRT_NODE_DEFAULTS_FILENAME))
 
     def __load_plugins(self):
diff --git a/scripts/tui/src/ovirt/node/config/defaults.py b/scripts/tui/src/ovirt/node/config/defaults.py
index 8846cfe..81f9815 100644
--- a/scripts/tui/src/ovirt/node/config/defaults.py
+++ b/scripts/tui/src/ovirt/node/config/defaults.py
@@ -291,6 +291,11 @@
         (valid.IPv4Address() | valid.Empty(or_none=True))(gateway)
 
     def transaction(self):
+        """Return all transactions to re-configure networking
+
+        FIXME this should be rewritten o allow more fine grained progress
+        informations
+        """
         class ConfigureNIC(utils.Transaction.Element):
             title = "Configuring NIC"
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifbcba57f5505c21d8fcf5a6d06dcaa551e06377a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list