From 646b585edc20c98d97eb861834c234004d44dd7b Mon Sep 17 00:00:00 2001 From: peusterm Date: Mon, 26 Jun 2017 09:59:12 +0200 Subject: [PATCH] Fix: Name shortening. Still an ugly fix but ok for now. --- src/emuvim/api/openstack/compute.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/emuvim/api/openstack/compute.py b/src/emuvim/api/openstack/compute.py index 38796cf..be4324c 100755 --- a/src/emuvim/api/openstack/compute.py +++ b/src/emuvim/api/openstack/compute.py @@ -519,14 +519,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 -- 2.25.1