def handleDelete(msg): table, data, installation = msg['table'], json.loads(msg['data']), msg['installation'] if table == 'tags': if data['name']: return tagHandler.delete(data['name'], data['controller_ip']) else: print("Error: Unsupported table: %s" % (table)) return False
def delete(installation, controller_ip, tag_name=None): if tag_name is None: res = tagHandler.delete_by_controller(installation, controller_ip) else: res = tagHandler.delete(installation, controller_ip, tag_name) if res: return OkResponse("Successfully removed the tag") else: return ConflictResponse("Could not delete the tag for that controller/installation/customer")