Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions Actifio/Actifio.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def get_jobs(self, **kwargs):
'''
try:
lsjob_out = self.run_uds_command('info', 'lsjob', {'filtervalue': kwargs})
lsjobhist_out = self.run_uds_command( 'info', 'lsjobhistory', {'filtervalue': kwargs})
lsjobhist_out = self.run_uds_command('info', 'lsjobhistory', {'filtervalue': kwargs})
except:
raise
else:
Expand Down Expand Up @@ -647,7 +647,7 @@ def clone_database(self, source_hostname="", source_appname="", source_applicati

This method creates a virtual clone of Oracle or SQL server database.

Agrs:
Args:

:source_hostname: Hostname of the source host where the database was captured from
:source_appname: source application name, or the database name
Expand Down Expand Up @@ -845,9 +845,6 @@ def clone_database(self, source_hostname="", source_appname="", source_applicati
mountimage_args.__setitem__('parts', dbnames)

provisioningoptions = "<provisioningoptions>" + provisioningoptions + "</provisioningoptions>"

# print(provisioningoptions)

mountimage_args.__setitem__('restoreoption', {'provisioningoptions': provisioningoptions})

try:
Expand Down Expand Up @@ -915,7 +912,7 @@ def simple_mount(self, source_application=None, target_host=None, mount_image=No

*Else*

:source_application (required): ActApplication object refereing to source application
:source_application (required): ActApplication object referring to source application

*If not target-host is None*

Expand Down Expand Up @@ -970,7 +967,7 @@ def simple_mount(self, source_application=None, target_host=None, mount_image=No
if mount_image is None:
raise ActUserError("Unable to find a suitable image for the 'restoretime' and 'strict_policy' criteria.")

mountimage_args.__setitem__('image', mount_image.imagename)
mountimage_args.__setitem__('image', mount_image.printable)

if isinstance(target_host, ActHost):
if source_application.friendlytype == "VMBackup":
Expand Down Expand Up @@ -1022,19 +1019,18 @@ def simple_mount(self, source_application=None, target_host=None, mount_image=No
# get the list of restore options

restoreopts = mount_image.restoreoptions('mount', target_host)

restoreopts_data = []

for opt in restoreopts:
kwargs_opt = kwargs.get(opt.name)
if kwargs_opt is not None:
restoreopts_data.append(opt.name + "-" + + "=" + str(kwargs_opt))
#restoreopts_data.append(opt.name + "-" + + "=" + str(kwargs_opt))
restoreopts_data.append('{}={}'.format(opt.name, str(kwargs_opt)))

if len(restoreopts_data) != 0:
mountimage_args.__setitem__('restoreoption', ','.join(restoreopts_data))

mountimage_out = self.run_uds_command('task', 'mountimage', mountimage_args)

result_job_name = mountimage_out['result'].split(" ")[0]
result_image_name = mountimage_out['result'].split(" ")[3]

Expand Down Expand Up @@ -1080,5 +1076,8 @@ def unmount_image (self, image=None, delete=True, nowait=True, pre_script="", po
if len(script_data) != 0:
udsargs.__setitem__('script', ';'.join(script_data))

udsreturn = self.run_uds_command("task","unmountimage", udsargs)
udsreturn = self.run_uds_command("task", "unmountimage", udsargs)
result_job_name = udsreturn['result'].split(" ")[0]

return self.get_jobs(jobname=result_job_name)[0]