Skip to content

Commit 73afc61

Browse files
committed
Set default API Version
Set default API Version to 1.12 and handled case when the version is not explicitly set as a command line parameter
1 parent 03e149d commit 73afc61

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

List_Volumes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Global Variables
1616
VERSION = '1.1.0'
17-
API_VERSION = '1.12'
17+
DEFAULT_API_VERSION = '1.12'
1818
HEADER = 'Pure Storage List Volumes (' + VERSION + ')'
1919
BANNER = ('=' * 102)
2020
DEBUG_LEVEL = 0
@@ -277,6 +277,9 @@ def main():
277277
if flashArray == None:
278278
sys.exit('Exiting: You must provide FlashArray details')
279279

280+
if API_VERSION == None:
281+
API_VERSION = DEFAULT_API_VERSION
282+
280283
if api_token == None and user == None:
281284
sys.exit('Exiting: You must provide either API Token details or username and password')
282285

0 commit comments

Comments
 (0)