Skip to content

Commit 9c673d1

Browse files
committed
fix: reorder code
1 parent 7967c72 commit 9c673d1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ibmsecurity/isam/base/container_ext/volume.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ def import_zip(isamAppliance, filename, volume_name=None, volume_id=None, check_
6666
import os.path
6767
logger.debug(f"\n\nTrying to import {filename}\n\n")
6868

69+
if volume_id is None and volume_name is None:
70+
return isamAppliance.create_return_object(warnings=["Volume name or volume id need to be specified"])
71+
6972
if volume_id is None:
7073
volume_id = search(isamAppliance, volume_name)
7174
volume_id = volume_id.get('data', None)
72-
73-
if volume_id is None and volume_name is None:
74-
return isamAppliance.create_return_object(warnings=["Volume name or volume id need to be specified"])
75+
logger.debug(f"\n\nVolume id is now set to {volume_id}\n\n")
7576

7677
if force or os.path.exists(filename):
7778
return isamAppliance.invoke_put_files(
@@ -109,6 +110,7 @@ def search(isamAppliance, volume_name, check_mode=False, force=False):
109110
if obj["name"] == volume_name:
110111
return_obj["data"] = obj["id"]
111112
return_obj["rc"] = 0
113+
logger.debug(f"\n\nFound {obj['id']} for {volume_name}\n\n")
112114
break
113115

114116
return return_obj

0 commit comments

Comments
 (0)