From: Adam Israel Date: Mon, 9 Dec 2019 02:44:29 +0000 (-0500) Subject: Workaround bug 936 X-Git-Tag: v7.0.0rc1~1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=18046070fb9abe4f21be255e533c2a96c047e50c;p=osm%2FN2VC.git Workaround bug 936 Apply a workaround for bug 936 that shortens the vnf and vdu id to no more than 12 characters, to keep the application name under the juju limit of 50 characters Change-Id: I2bb49032f9f3432d304139b6e6b5ae0f62dc2a2a Signed-off-by: Adam Israel --- diff --git a/n2vc/n2vc_juju_conn.py b/n2vc/n2vc_juju_conn.py index 6ada220..65dac3e 100644 --- a/n2vc/n2vc_juju_conn.py +++ b/n2vc/n2vc_juju_conn.py @@ -706,18 +706,22 @@ class N2VCJujuConnector(N2VCConnector): :return: app-vnf--vdu--cnt- """ + # TODO: Enforce the Juju 50-character application limit + # split namespace components _, _, vnf_id, vdu_id, vdu_count = self._get_namespace_components(namespace=namespace) if vnf_id is None or len(vnf_id) == 0: vnf_id = '' else: - vnf_id = 'vnf-' + vnf_id + # Shorten the vnf_id to its last twelve characters + vnf_id = 'vnf-' + vnf_id[-12:] if vdu_id is None or len(vdu_id) == 0: vdu_id = '' else: - vdu_id = '-vdu-' + vdu_id + # Shorten the vdu_id to its last twelve characters + vdu_id = '-vdu-' + vdu_id[-12:] if vdu_count is None or len(vdu_count) == 0: vdu_count = ''