Migration to yaql 1.0
* Code migrated to yaql 1.0.0 * New MuranoPL object initialization * Lots of refactoring See referenced specs for more information Implements: blueprint migrate-to-yaql-vnext Implements: blueprint object-construction Depends-on: I7f314634ab5f08a521e51082d5c84dffca4b0b5c Closes-Bug: #1454264 Change-Id: I740a4f83c76d8b56a1da585a739d770ef823a524
This commit is contained in:
@@ -28,11 +28,10 @@ CONF = config.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# noinspection PyPep8Naming
|
||||
class GlanceClient(object):
|
||||
def initialize(self, _context):
|
||||
client_manager = helpers.get_environment(_context).clients
|
||||
self.client = client_manager.get_client(_context, "glance", True,
|
||||
def __init__(self, context):
|
||||
client_manager = helpers.get_environment(context).clients
|
||||
self.client = client_manager.get_client(context, "glance", True,
|
||||
self.create_glance_client)
|
||||
|
||||
def list(self):
|
||||
@@ -44,7 +43,7 @@ class GlanceClient(object):
|
||||
except StopIteration:
|
||||
break
|
||||
|
||||
def getByName(self, name):
|
||||
def get_by_name(self, name):
|
||||
images = list(self.client.images.list(filters={"name": name}))
|
||||
if len(images) > 1:
|
||||
raise AmbiguousNameException(name)
|
||||
@@ -53,7 +52,7 @@ class GlanceClient(object):
|
||||
else:
|
||||
return GlanceClient._format(images[0])
|
||||
|
||||
def getById(self, imageId):
|
||||
def get_by_id(self, imageId):
|
||||
image = self.client.images.get(imageId)
|
||||
return GlanceClient._format(image)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user