[node-patches] Change in ovirt-node[master]: Allow for bonding options in auto install
rbarry at redhat.com
rbarry at redhat.com
Wed Sep 24 17:37:55 UTC 2014
Ryan Barry has uploaded a new change for review.
Change subject: Allow for bonding options in auto install
......................................................................
Allow for bonding options in auto install
Splitting shell arrays on whitespace doesn't allow for multiple
options to be passed conveniently except comma separated. Show the
recommended syntax and change config.defaults to set and parse
comma-separated values for bonding options instead of whitespace.
Change-Id: Ice355b709d5e1515226fe211786b13489f293d0d
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1046394
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M scripts/ovirt-init-functions.sh.in
M src/ovirt/node/config/defaults.py
2 files changed, 6 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/48/33348/1
diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index d90b6eb..8d2f42c 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -357,7 +357,7 @@
# ntp=server[,server]
# vlan=id
# network_layout=bridged|direct
- # bond_setup=<bondname>:<bondslaves>:[:<options>]
+ # bond_setup=<bondname>:<bondslave,bondslave>:[:<option_arg,option_arg>]
# static network configuration
ip_address=
ip_gateway=
diff --git a/src/ovirt/node/config/defaults.py b/src/ovirt/node/config/defaults.py
index 64d7e6b..f8af9a3 100644
--- a/src/ovirt/node/config/defaults.py
+++ b/src/ovirt/node/config/defaults.py
@@ -509,12 +509,16 @@
options = options or self.default_options
return {"OVIRT_BOND_SLAVES": ",".join(slaves) if slaves else None,
- "OVIRT_BOND_OPTIONS": options if name else None}
+ "OVIRT_BOND_OPTIONS": ",".join(options.split(
+ " ")) if name else None}
def retrieve(self):
cfg = super(NicBonding, self).retrieve()
cfg.update({"slaves": (cfg["slaves"].split(",") if cfg["slaves"]
else [])})
+ cfg.update({"options": (" ".join(cfg["options"].split(","))
+ if cfg["options"]
+ else "mode=balance-rr miimon=100")})
return cfg
def configure_no_bond(self):
--
To view, visit http://gerrit.ovirt.org/33348
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice355b709d5e1515226fe211786b13489f293d0d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>
More information about the node-patches
mailing list