Allow ironic to use ssh commands
Due to minor differences in the ssh command syntax between Nova-Baremetal and Ironic, the regex on allowed commands failed for ironic. This patch modifies the regex to allow for these differences. Change-Id: I160e4202952b7551b855dc7d91784d6a184cb0ed Closes-Bug: #1298731
This commit is contained in:
@@ -62,10 +62,10 @@ def run_command(orig_command):
|
||||
|
||||
|
||||
RE_COMMANDS = {
|
||||
r"""^/usr/bin/virsh list --all \| tail -n \+2 \| awk -F" " '{print \$2}'$""": run_command,
|
||||
r"""^/usr/bin/virsh dumpxml [a-z0-9_]+ \| grep "mac address" \| awk -F"'" '{print \$2}' \| tr -d ':'$""": run_command,
|
||||
r"""^/usr/bin/virsh list --all\|grep running\|awk -v qc='"' -F" " '{print qc\$2qc}'$""": run_command,
|
||||
r"""^/usr/bin/virsh (start|destroy|reset) "?[a-z0-9_]+"?$""": run_command
|
||||
r"""^/usr/bin/virsh( --connect qemu:///system)? list --all \| tail -n \+2 \| awk -F" " '{print \$2}'$""": run_command,
|
||||
r"""^/usr/bin/virsh( --connect qemu:///system)? dumpxml [a-z0-9_]+ \| grep "mac address" \| awk -F"'" '{print \$2}' \| tr -d ':'$""": run_command,
|
||||
r"""^/usr/bin/virsh( --connect qemu:///system)? list --all\|grep running( )?\|( )?awk -v qc='"' -F" " '{print qc\$2qc}'$""": run_command,
|
||||
r"""^/usr/bin/virsh( --connect qemu:///system)? (start|destroy|reset) "?[a-z0-9_]+"?$""": run_command
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user