From: garciadeblas Date: Thu, 21 Mar 2019 08:55:44 +0000 (+0100) Subject: Fixed some typos X-Git-Tag: v6.0.0~35 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F7345%2F1;p=osm%2FRO.git Fixed some typos Change-Id: I6e98001c2fc94d4efd5d2b3be0b401a3c7a862fb Signed-off-by: garciadeblas --- diff --git a/osm_ro/db_base.py b/osm_ro/db_base.py index 58f5b8cf..e946f00d 100644 --- a/osm_ro/db_base.py +++ b/osm_ro/db_base.py @@ -752,12 +752,12 @@ class db_base(): return rows @retry - def get_table_by_uuid_name(self, table, uuid_name, error_item_text=None, allow_serveral=False, WHERE_OR={}, WHERE_AND_OR="OR", attempt=_ATTEMPT): + def get_table_by_uuid_name(self, table, uuid_name, error_item_text=None, allow_several=False, WHERE_OR={}, WHERE_AND_OR="OR", attempt=_ATTEMPT): ''' Obtain One row from a table based on name or uuid. Attribute: table: string of table name uuid_name: name or uuid. If not uuid format is found, it is considered a name - allow_severeral: if False return ERROR if more than one row are founded + allow_several: if False return ERROR if more than one row are found error_item_text: in case of error it identifies the 'item' name for a proper output text 'WHERE_OR': dict of key:values, translated to key=value OR ... (Optional) 'WHERE_AND_OR: str 'AND' or 'OR'(by default) mark the priority to 'WHERE AND (WHERE_OR)' or (WHERE) OR WHERE_OR' (Optional @@ -784,9 +784,9 @@ class db_base(): number = self.cur.rowcount if number == 0: raise db_base_Exception("No {} found with {} '{}'".format(error_item_text, what, uuid_name), http_code=httperrors.Not_Found) - elif number > 1 and not allow_serveral: + elif number > 1 and not allow_several: raise db_base_Exception("More than one {} found with {} '{}'".format(error_item_text, what, uuid_name), http_code=httperrors.Conflict) - if allow_serveral: + if allow_several: rows = self.cur.fetchall() else: rows = self.cur.fetchone() diff --git a/osm_ro/nfvo_db.py b/osm_ro/nfvo_db.py index d0abdf38..86144def 100644 --- a/osm_ro/nfvo_db.py +++ b/osm_ro/nfvo_db.py @@ -491,7 +491,7 @@ class nfvo_db(db_base.db_base): return item_changed # def get_instance_scenario(self, instance_scenario_id, tenant_id=None): -# '''Obtain the scenario instance information, filtering by one or serveral of the tenant, uuid or name +# '''Obtain the scenario instance information, filtering by one or several of the tenant, uuid or name # instance_scenario_id is the uuid or the name if it is not a valid uuid format # Only one scenario isntance must mutch the filtering or an error is returned # ''' @@ -543,7 +543,7 @@ class nfvo_db(db_base.db_base): @retry @with_transaction(cursor='dict') def get_scenario(self, scenario_id, tenant_id=None, datacenter_vim_id=None, datacenter_id=None): - '''Obtain the scenario information, filtering by one or serveral of the tenant, uuid or name + '''Obtain the scenario information, filtering by one or several of the tenant, uuid or name scenario_id is the uuid or the name if it is not a valid uuid format if datacenter_vim_id,d datacenter_id is provided, it supply aditional vim_id fields with the matching vim uuid Only one scenario must mutch the filtering or an error is returned @@ -1057,7 +1057,7 @@ class nfvo_db(db_base.db_base): @retry(command='delete', extra='No dependences can avoid deleting!!!!') @with_transaction(cursor='dict') def delete_instance_scenario(self, instance_id, tenant_id=None): - '''Deletes a instance_Scenario, filtering by one or serveral of the tenant, uuid or name + '''Deletes a instance_Scenario, filtering by one or several of the tenant, uuid or name instance_id is the uuid or the name if it is not a valid uuid format Only one instance_scenario must mutch the filtering or an error is returned '''