Commit d5e9de7c authored by Sebastian Gebhard's avatar Sebastian Gebhard Committed by Klaus Aehlig

Don't check for master netdev when using OVS

This patch disables checking if the given master_netdev exists during cluster
init.
When OVS is used, the needed Open vSwitch will be created later on (with
OpClusterPostInit) and is thus not available at this point of time.
Signed-off-by: default avatarSebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent a1578ccf
......@@ -614,11 +614,14 @@ def InitCluster(cluster_name, mac_prefix, # pylint: disable=R0913, R0914
raise errors.OpPrereqError("Invalid mac prefix given '%s'" % mac_prefix,
errors.ECODE_INVAL)
result = utils.RunCmd(["ip", "link", "show", "dev", master_netdev])
if result.failed:
raise errors.OpPrereqError("Invalid master netdev given (%s): '%s'" %
(master_netdev,
result.output.strip()), errors.ECODE_INVAL)
if not nicparams.get('mode', None) == "openvswitch":
# Do not do this check if mode=openvswitch, since the openvswitch is not
# created yet
result = utils.RunCmd(["ip", "link", "show", "dev", master_netdev])
if result.failed:
raise errors.OpPrereqError("Invalid master netdev given (%s): '%s'" %
(master_netdev,
result.output.strip()), errors.ECODE_INVAL)
dirs = [(pathutils.RUN_DIR, constants.RUN_DIRS_MODE)]
utils.EnsureDirs(dirs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment