diff options
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service/mod')
-rwxr-xr-x | components/pm-subscription-handler/pmsh_service/mod/api/db_models.py | 12 | ||||
-rwxr-xr-x | components/pm-subscription-handler/pmsh_service/mod/network_function.py | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py b/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py index ff172d1c..a8b13e89 100755 --- a/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py +++ b/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py @@ -66,8 +66,8 @@ class NetworkFunctionModel(db.Model): cascade='all, delete-orphan', backref='nf') - def __init__(self, nf_name, model_invariant_id, model_version_id, sdnc_model_name=None, - sdnc_model_version=None): + def __init__(self, nf_name, model_invariant_id, model_version_id, sdnc_model_name, + sdnc_model_version): self.nf_name = nf_name self.model_invariant_id = model_invariant_id self.model_version_id = model_version_id @@ -79,11 +79,11 @@ class NetworkFunctionModel(db.Model): def to_nf(self): from mod.network_function import NetworkFunction - return NetworkFunction(**{'nf_name': self.nf_name, + return NetworkFunction(sdnc_model_name=self.sdnc_model_name, + sdnc_model_version=self.sdnc_model_version, + **{'nf_name': self.nf_name, 'model_invariant_id': self.model_invariant_id, - 'model_version_id': self.model_version_id, - 'sdnc_model_name': self.sdnc_model_name, - 'sdnc_model_version': self.sdnc_model_version}) + 'model_version_id': self.model_version_id}) class NfSubRelationalModel(db.Model): diff --git a/components/pm-subscription-handler/pmsh_service/mod/network_function.py b/components/pm-subscription-handler/pmsh_service/mod/network_function.py index fd940385..798da00b 100755 --- a/components/pm-subscription-handler/pmsh_service/mod/network_function.py +++ b/components/pm-subscription-handler/pmsh_service/mod/network_function.py @@ -24,13 +24,13 @@ from mod.api.db_models import NetworkFunctionModel class NetworkFunction: - def __init__(self, **kwargs): + def __init__(self, sdnc_model_name=None, sdnc_model_version=None, **kwargs): """ Object representation of the NetworkFunction. """ self.nf_name = kwargs.get('nf_name') self.model_invariant_id = kwargs.get('model_invariant_id') self.model_version_id = kwargs.get('model_version_id') - self.sdnc_model_name = None - self.sdnc_model_version = None + self.sdnc_model_name = sdnc_model_name + self.sdnc_model_version = sdnc_model_version @classmethod def nf_def(cls): |