def get_iothub_opt(
argv,
connection_string,
device_id):
if len(argv) > 0:
try:
opts, args = getopt.getopt(
argv, "hd:c:", [
"connectionstring=", "deviceid="])
except getopt.GetoptError as get_opt_error:
raise OptionError("Error: %s" % get_opt_error.msg)
for opt, arg in opts:
if opt == '-h':
raise OptionError("Help:")
elif opt in ("-c", "--connectionstring"):
connection_string = arg
elif opt in ("-d", "--deviceid"):
device_id = arg
if connection_string.find("HostName") < 0:
raise OptionError(
"Error: Hostname not found, not a valid connection string")
return connection_string, device_id
iothub_service_client_args.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录