Revision 8baa9ca7 lib/cmdlib/node.py
b/lib/cmdlib/node.py | ||
---|---|---|
112 | 112 |
raise errors.OpPrereqError("Cannot pass a node group when a node is" |
113 | 113 |
" being readded", errors.ECODE_INVAL) |
114 | 114 |
|
115 |
# OpenvSwitch: Warn user if link is missing |
|
116 |
if (self.op.ndparams[constants.ND_OVS] and not |
|
117 |
self.op.ndparams[constants.ND_OVS_LINK]): |
|
118 |
self.LogInfo("No physical interface for OpenvSwitch was given." |
|
119 |
" OpenvSwitch will not have an outside connection. This" |
|
120 |
" might not be what you want.") |
|
121 |
# OpenvSwitch: Fail if parameters are given, but OVS is not enabled. |
|
122 |
if (not self.op.ndparams[constants.ND_OVS] and |
|
123 |
(self.op.ndparams[constants.ND_OVS_NAME] or |
|
124 |
self.op.ndparams[constants.ND_OVS_LINK])): |
|
125 |
raise errors.OpPrereqError("OpenvSwitch name or link were given, but" |
|
126 |
" OpenvSwitch is not enabled. Please enable" |
|
127 |
" OpenvSwitch with --ovs", errors.ECODE_INVAL) |
|
128 |
|
|
115 | 129 |
def BuildHooksEnv(self): |
116 | 130 |
"""Build hooks env. |
117 | 131 |
|
... | ... | |
375 | 389 |
(verifier, nl_payload[failed])) |
376 | 390 |
raise errors.OpExecError("ssh/hostname verification failed") |
377 | 391 |
|
392 |
# OpenvSwitch initialization on the node |
|
393 |
if self.new_node.ndparams[constants.ND_OVS]: |
|
394 |
result = self.rpc.call_node_configure_ovs( |
|
395 |
self.new_node.name, |
|
396 |
self.new_node.ndparams[constants.ND_OVS_NAME], |
|
397 |
self.new_node.ndparams[constants.ND_OVS_LINK]) |
|
398 |
|
|
378 | 399 |
if self.op.readd: |
379 | 400 |
self.context.ReaddNode(self.new_node) |
380 | 401 |
RedistributeAncillaryFiles(self) |
Also available in: Unified diff