return output
def vswitchCfgMod(action_args):
- cmd = [cfg_mod, "--config-file=" + vswitchd_cfg_filename] + action_args
+ cmd = [cfg_mod, "-vANY:console:emer",
+ "--config-file=" + vswitchd_cfg_filename] + action_args
exitcode = subprocess.call(cmd)
if exitcode != 0:
log.error("cfg-mod failed with exit code "
xenstore-rm "${HOTPLUG}/hotplug"
vif=vif${DOMID}.${DEVID}
logger -t scripts-vif "${vif} has been removed"
- $cfg-mod -F /etc/vswitchd.conf --del-match="bridge.*.port=${vif}" \
+ $cfg-mod -vANY:console:emer -F /etc/vswitchd.conf \
+ --del-match="bridge.*.port=${vif}" \
--del-match="vlan.${vif}.[!0-9]*"
;;
esac
print 'failed.'
def modify_config(commands):
- run_command(['/root/vswitch/bin/cfg-mod', '-F', '/etc/vswitchd.conf']
+ run_command(['/root/vswitch/bin/cfg-mod', '-vANY:console:emer',
+ '-F', '/etc/vswitchd.conf']
+ commands + ['-c'])
run_command(['/sbin/service', 'vswitch', 'reload'])
@staticmethod
def Get(key):
- cmd = [cfg_mod, "--config-file=" + vswitchd_cfg_filename, "-q", key]
+ cmd = [cfg_mod, "-vANY:console:emer", "-F", vswitchd_cfg_filename,
+ "-q", key]
output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()
if len(output) == 0 or output[0] == None:
output = ""