def server_rebuild(self, server, imageref, name=None, admin_password=None, **attrs): if imageref: attrs['image'] = {'id': imageref} if name: attrs['name'] = name if admin_password: attrs['adminPass'] = admin_password self.fake_server_get.update(attrs) return sdk.FakeResourceObject(self.fake_server_get)
def network_get(self, value): return sdk.FakeResourceObject(self.fake_network)
def server_update(self, server, **attrs): self.fake_server_get.update(attrs) return sdk.FakeResourceObject(self.fake_server_get)
def server_get(self, server): return sdk.FakeResourceObject(self.fake_server_get)
def server_create(self, **attrs): self.fake_server_create['id'] = uuidutils.generate_uuid() self.fake_server_get['id'] = self.fake_server_create['id'] return sdk.FakeResourceObject(self.fake_server_create)
def image_find(self, name_or_id, ignore_missing=False): return sdk.FakeResourceObject(self.fake_image)
def server_create(self, **attrs): return sdk.FakeResourceObject(self.fake_server_create)