Fix bug with script load from database

This commit is contained in:
Joshua Boniface 2020-02-18 20:33:12 -05:00
parent ca68321be3
commit 097f0d9be4
1 changed files with 5 additions and 1 deletions

View File

@ -1090,7 +1090,11 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True):
query = 'SELECT script FROM script WHERE id = %s' query = 'SELECT script FROM script WHERE id = %s'
args = (profile_data['script'],) args = (profile_data['script'],)
db_cur.execute(query, args) db_cur.execute(query, args)
vm_data['script'] = db_cur.fetchone() db_row = db_cur.fetchone()
if db_row:
vm_data['script'] = db_row.get('script')
else:
vm_data['script'] = None
if vm_data['script'] and not is_ova_install: if vm_data['script'] and not is_ova_install:
is_script_install = True is_script_install = True