import zipfile
import yaml
import threading
-from docker import Client as DockerClient
+from docker import DockerClient
from flask import Flask, request
import flask_restful as fr
from collections import defaultdict
dc = DockerClient()
for url in self.remote_docker_image_urls.itervalues():
if not FORCE_PULL: # only pull if not present (speedup for development)
- if len(dc.images(name=url)) > 0:
+ if len(dc.images.list(name=url)) > 0:
LOG.debug("Image %r present. Skipping pull." % url)
continue
LOG.info("Pulling image: %r" % url)
:param image_name: name of the docker image
:return:
"""
- return len(DockerClient().images(image_name)) > 0
+ return len(DockerClient().images.list(name=image_name)) > 0
def _calculate_placement(self, algorithm):
"""
status["memswap_limit"] = self.memswap_limit
status["state"] = self.dcli.inspect_container(self.dc)["State"]
status["id"] = self.dcli.inspect_container(self.dc)["Id"]
+ status["short_id"] = self.dcli.inspect_container(self.dc)["Id"][:12]
status["datacenter"] = (None if self.datacenter is None
else self.datacenter.label)
return status
datacenter=self,
flavor_name=flavor_name,
cpu_period = cpu_period,
- cpu_quota = cpu_quota
+ cpu_quota = cpu_quota,
+ environment = {'VNF_NAME':name}
)