Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tag_values = [x.strip() for x in args.tags.split(',')]
pruned['tags'] = tag_values
if args.add_tags:
data = client.add_tags(**pruned)
elif args.remove_tags:
data = client.remove_tags(**pruned)
elif args.set_tags:
data = client.set_tags(**pruned)
else:
raise ValueError("Tag action required.")
if args.classification:
data = client.set_classification_status(**pruned)
if args.monitor:
pruned['status'] = to_bool(args.monitor)
data = client.set_monitor_status(**pruned)
if args.sinkhole:
pruned['status'] = to_bool(args.sinkhole)
data = client.set_sinkhole_status(**pruned)
if args.dynamic_dns:
pruned['status'] = to_bool(args.dynamic_dns)
data = client.set_dynamic_dns_status(**pruned)
if args.ever_compromised:
pruned['status'] = to_bool(args.ever_compromised)
data = client.set_ever_compromised_status(**pruned)
if args.metadata:
data = client.get_metadata(**pruned)
elif kwargs.get('remove_tags'):
res = client.remove_tags(**params)
elif kwargs.get('set_tags'):
res = client.set_tags(**params)
else:
self.log.error("No tags provided.")
if params.get('classification'):
res = client.set_classification_status(**params)
if params.get('monitor'):
params['status'] = to_bool(params['monitor'])
res = client.set_monitor_status(**params)
if params.get('sinkhole'):
params['status'] = to_bool(params['sinkhole'])
res = client.set_sinkhole_status(**params)
if params.get('dynamic_dns'):
params['status'] = to_bool(params['dynamic_dns'])
res = client.set_dynamic_dns_status(**params)
if params.get('ever_compromised'):
params['status'] = to_bool(params['ever_compromised'])
res = client.set_ever_compromised_status(**params)
if params.get('metadata'):
res = client.get_metadata(**params)
return res
data = client.set_classification_status(**pruned)
if args.monitor:
pruned['status'] = to_bool(args.monitor)
data = client.set_monitor_status(**pruned)
if args.sinkhole:
pruned['status'] = to_bool(args.sinkhole)
data = client.set_sinkhole_status(**pruned)
if args.dynamic_dns:
pruned['status'] = to_bool(args.dynamic_dns)
data = client.set_dynamic_dns_status(**pruned)
if args.ever_compromised:
pruned['status'] = to_bool(args.ever_compromised)
data = client.set_ever_compromised_status(**pruned)
if args.metadata:
data = client.get_metadata(**pruned)
return data
elif args.remove_tags:
data = client.remove_tags(**pruned)
elif args.set_tags:
data = client.set_tags(**pruned)
else:
raise ValueError("Tag action required.")
if args.classification:
data = client.set_classification_status(**pruned)
if args.monitor:
pruned['status'] = to_bool(args.monitor)
data = client.set_monitor_status(**pruned)
if args.sinkhole:
pruned['status'] = to_bool(args.sinkhole)
data = client.set_sinkhole_status(**pruned)
if args.dynamic_dns:
pruned['status'] = to_bool(args.dynamic_dns)
data = client.set_dynamic_dns_status(**pruned)
if args.ever_compromised:
pruned['status'] = to_bool(args.ever_compromised)
data = client.set_ever_compromised_status(**pruned)
if args.metadata:
data = client.get_metadata(**pruned)
return data
else:
raise ValueError("Tag action required.")
if args.classification:
data = client.set_classification_status(**pruned)
if args.monitor:
pruned['status'] = to_bool(args.monitor)
data = client.set_monitor_status(**pruned)
if args.sinkhole:
pruned['status'] = to_bool(args.sinkhole)
data = client.set_sinkhole_status(**pruned)
if args.dynamic_dns:
pruned['status'] = to_bool(args.dynamic_dns)
data = client.set_dynamic_dns_status(**pruned)
if args.ever_compromised:
pruned['status'] = to_bool(args.ever_compromised)
data = client.set_ever_compromised_status(**pruned)
if args.metadata:
data = client.get_metadata(**pruned)
return data
else:
self.log.error("No tags provided.")
if params.get('classification'):
res = client.set_classification_status(**params)
if params.get('monitor'):
params['status'] = to_bool(params['monitor'])
res = client.set_monitor_status(**params)
if params.get('sinkhole'):
params['status'] = to_bool(params['sinkhole'])
res = client.set_sinkhole_status(**params)
if params.get('dynamic_dns'):
params['status'] = to_bool(params['dynamic_dns'])
res = client.set_dynamic_dns_status(**params)
if params.get('ever_compromised'):
params['status'] = to_bool(params['ever_compromised'])
res = client.set_ever_compromised_status(**params)
if params.get('metadata'):
res = client.get_metadata(**params)
return res