Skip to content

Commit

Permalink
migrate: fix for maybe missing TEMPLATE arg in OpenNebula 5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed Feb 13, 2020
1 parent 8efafc6 commit 9f47e82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tm/postmigrate
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ DST_HOST = sys.argv[2]
DST_PATH = sys.argv[3]
VM_ID = sys.argv[4]
DS_ID = sys.argv[5]
TEMPLATE = sys.argv[6]


def main():
util.log_info("Entering tm/postmigrate, from='{f}' to='{t}'".format(f=SRC_HOST, t=DST_HOST))

try:
TEMPLATE = sys.argv[6]
vmxml = base64.b64decode(TEMPLATE)
except base64.binascii.Error:
except (base64.binascii.Error, IndexError):
# since opennebula 5.10 the template XML should be provided via STDIN
outstr = io.BytesIO()
base64.decode(sys.stdin, outstr)
Expand Down
4 changes: 2 additions & 2 deletions tm/premigrate
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ DST_HOST = sys.argv[2]
DST_PATH = sys.argv[3]
VM_ID = int(sys.argv[4])
DS_ID = sys.argv[5]
TEMPLATE = sys.argv[6]


def main():
util.log_info("Entering tm/premigrate from {s} to {t} in {tp}".format(s=SRC_HOST, t=DST_HOST, tp=DST_PATH))

try:
TEMPLATE = sys.argv[6]
vmxml = base64.b64decode(TEMPLATE)
except base64.binascii.Error:
except (base64.binascii.Error, IndexError):
# since opennebula 5.10 the template XML should be provided via STDIN
outstr = io.BytesIO()
base64.decode(sys.stdin, outstr)
Expand Down

0 comments on commit 9f47e82

Please sign in to comment.