Merge pull request #214 from mpeuster/master
authorpeusterm <manuel.peuster@uni-paderborn.de>
Fri, 28 Apr 2017 07:02:44 +0000 (09:02 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Fri, 28 Apr 2017 07:02:44 +0000 (09:02 +0200)
Fix: Let dummy GK consider vcpus field in VNFDs

ansible/install.yml
src/emuvim/api/sonata/dummygatekeeper.py
utils/docker/Dockerfile

index 4e4ff01..d5f00ee 100755 (executable)
@@ -66,5 +66,8 @@
    - name: install latest urllib3 (fix error urllib3.connection.match_hostname = match_hostname)
      pip: name=urllib3 state=latest
 
+   - name: install iptc
+     pip: name=python-iptables state=latest
+
 
 
index 59960a9..813bc5e 100755 (executable)
@@ -272,7 +272,9 @@ class Service(object):
             # 3. get the resource limits
             res_req = u.get("resource_requirements")
             cpu_list = res_req.get("cpu").get("cores")
-            if not cpu_list or len(cpu_list)==0:
+            if cpu_list is None:
+                cpu_list = res_req.get("cpu").get("vcpus")
+            if cpu_list is None:
                 cpu_list="1"
             cpu_bw = res_req.get("cpu").get("cpu_bw")
             if not cpu_bw:
index 238ed44..df52ccc 100755 (executable)
@@ -42,7 +42,7 @@ RUN apt-get install -y curl && \
 RUN curl -fsSL https://get.docker.com/gpg | apt-key add -
 RUN curl -fsSL https://get.docker.com/ | sh
 
-RUN pip install -U urllib3 setuptools pyparsing docker
+RUN pip install -U urllib3 setuptools pyparsing docker python-iptables
 WORKDIR /
 RUN git clone https://github.com/containernet/containernet.git
 RUN containernet/util/install.sh