From: peusterm Date: Mon, 26 Jun 2017 07:59:12 +0000 (+0200) Subject: Fix: Name shortening. Still an ugly fix but ok for now. X-Git-Tag: v3.1~17^2~6^2~8 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=25be5775e70e1d19c5307e7744ccf7bfbc397081;p=osm%2Fvim-emu.git Fix: Name shortening. Still an ugly fix but ok for now. --- diff --git a/src/emuvim/api/openstack/compute.py b/src/emuvim/api/openstack/compute.py index 09957b7..ddb3c93 100755 --- a/src/emuvim/api/openstack/compute.py +++ b/src/emuvim/api/openstack/compute.py @@ -513,14 +513,17 @@ class OpenstackCompute(object): self.computeUnits[server.id] = server return server - def _shorten_server_name(self, name, char_limit=64): + def _shorten_server_name(self, name, char_limit=9): """ Docker does not like too long instance names. This function provides a shorter name if needed """ + # TODO this is a ugly hack and needs to be fixed LOG.debug("Long server name: {}".format(name)) if len(name) > char_limit: # construct a short name + parts = name.split("_") + name = name.replace("_vnf", "") name = name[-char_limit:].strip("-_ .") LOG.debug("Short server name: {}".format(name)) return name