def delete(args): """Delete records. Argument: args: arguments object """ # for DELETE HTTP method action = False if ((args.__dict__.get('domain') and args.__dict__.get('name') and args.__dict__.get('rtype') and args.__dict__.get('content'))): # for delete sub-command domain = args.domain o = JSONConverter(domain) name, rtype, content, ttl, priority = get_record_params(args) record_dict = o.set_record(name, rtype, content, ttl, priority) json = set_json(domain, action, record=record_dict) else: # for bulk_delete sub-command if args.__dict__.get('domain'): domain = args.domain else: domain = check_infile(args.infile) json = set_json(domain, action, filename=args.infile) password = get_password(args) token = connect.get_token(args.username, password, args.server) processing.delete_records(args.server, token, json) if args.auto_update_soa == 'True': update_soa_serial(args)