Просмотр исходного кода

Fixes OpenStack instance name regex search

Alessandro Pilotti 9 лет назад
Родитель
Сommit
24253ee2a7
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      coriolis/providers/openstack/__init__.py

+ 2 - 1
coriolis/providers/openstack/__init__.py

@@ -1139,7 +1139,8 @@ class ExportProvider(base.BaseExportProvider):
 
     @utils.retry_on_error()
     def _get_instance(self, nova, instance_name):
-        instances = nova.servers.list(search_opts={'name': instance_name})
+        instances = nova.servers.list(
+            search_opts={'name': "^%s$" % instance_name})
         if len(instances) > 1:
             raise exception.CoriolisException(
                 'More than one instance exists with name: %s' % instance_name)