def _group_deletion(group_id): try: group_obj = Group.get_group_name_id(group_id, get_obj=True) if group_obj: Group.purge_group(group_id, proceed=proceed_flag) validate_deletion(group_id) else: node_obj = Node.get_node_by_id(group_id) # If the ObjectId entered is not of a Group if node_obj: if node_obj.collection_set: for each_obj_id in node_obj.collection_set: _group_deletion(each_obj_id) del_status, del_status_msg = delete_node(node_id=node_obj._id, deletion_type=1) validate_deletion(node_obj._id) except Exception as group_del_err: print "\n Error occurred.", str(group_del_err)
def _group_deletion(group_id): try: group_obj = Group.get_group_name_id(group_id, get_obj=True) if group_obj: Group.purge_group(group_id, proceed=proceed_flag) validate_deletion(group_id) else: node_obj = Node.get_node_by_id(group_id) # If the ObjectId entered is not of a Group if node_obj: if node_obj.collection_set: for each_obj_id in node_obj.collection_set: _group_deletion(each_obj_id) del_status, del_status_msg = delete_node( node_id=node_obj._id, deletion_type=1) validate_deletion(node_obj._id) except Exception as group_del_err: print "\n Error occurred.", str(group_del_err)
def handle(self, *args, **options): print "Enter group name or _id: " group_id = raw_input() Group.purge_group(group_id, proceed=False)
def handle(self, *args, **options): print "Enter group name or _id: " group_id = raw_input() Group.purge_group(group_id, proceed=False)