in azurepipelines/e2e_test/scenarios/testingtoolkit/_adu_test_toolkit.py [0:0]
def ParseFromCLI(self):
#
# Get opt will use the following for arguments.
# (-a)--adu-endpoint
# (-i)--adu-instance-id
# (-u)--iothub-url
# (-c)--iothub-connection-string
# (-r)--msi-client-id
# (-t)--msi-tenant-id
# (-p)--msi-resource-id
shortopts = "a:i:u:c:r:t:p:"
longopts = ['adu-endpoint=', 'adu-instance-id=', 'iothub-url=',
'msi-client-id=', 'msi-tenant-id=', 'msi-resource-id=', ]
optlist, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
#
# Require that all parameters have been passed
#
if (len(optlist) < 7):
return None
for opt, val in optlist:
if (opt == "-a" or opt == "--" + longopts[0]):
self._aduEndpoint = val
elif (opt == "-i" or opt == "--" + longopts[1]):
self._aduInstanceId = val
elif (opt == "-u" or opt == "--" + longopts[2]):
self._iotHubUrl = val
elif (opt == "-r" or opt == "--" + longopts[4]):
self._msiClientId = val
elif (opt == "-t" or opt == "--" + longopts[5]):
self._msiTenantId = val
elif (opt == "-p" or opt == "--" + longopts[6]):
self._msiResourceId = val
self._configured = True