Giter Site home page Giter Site logo

Comments (4)

ssalvatori avatar ssalvatori commented on June 23, 2024

I have the same problem, I tried changing the path in the deimos source but now I have a problem with memory attribute for the cgroups object

from deimos.

ssalvatori avatar ssalvatori commented on June 23, 2024

I made a little change in deimos to work with centos 6.5 and kernel 3.15.*

[root@tmparq deimos]# uname -a
Linux tmparq.cloud.lan.com 3.15.3-1.el6.elrepo.x86_64 #1 SMP Tue Jul 1 12:42:44 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

diff --git a/deimos/docker.py b/deimos/docker.py
index b268624..90315c4 100644
--- a/deimos/docker.py
+++ b/deimos/docker.py
@@ -106,9 +106,9 @@ class Status(_Struct):

 def cgroups(cid):
     paths = []
-    paths += glob.glob("/sys/fs/cgroup/*/" + cid)
-    paths += glob.glob("/sys/fs/cgroup/*/docker/" + cid)
-    return dict((s.split("/")[4], s) for s in paths)
+    paths += glob.glob("/cgroup/*/" + cid)
+    paths += glob.glob("/cgroup/*/docker/" + cid)
+    return dict((s.split("/")[2], s) for s in paths)

from deimos.

solidsnack avatar solidsnack commented on June 23, 2024

Maybe something like this would work everywhere?

diff --git a/deimos/docker.py b/deimos/docker.py
index b268624..7d5eef0 100644
--- a/deimos/docker.py
+++ b/deimos/docker.py
@@ -108,7 +108,10 @@ def cgroups(cid):
     paths = []
     paths += glob.glob("/sys/fs/cgroup/*/" + cid)
     paths += glob.glob("/sys/fs/cgroup/*/docker/" + cid)
-    return dict((s.split("/")[4], s) for s in paths)
+    paths += glob.glob("/cgroup/*/" + cid)
+    paths += glob.glob("/cgroup/*/docker/" + cid)
+    named_cgroups = [(s.split("/cgroup/")[1].split("/")[0], s) for s in paths]
+    return dict(named_cgroups)


 def matching_image_for_host(distro=None, release=None, *args, **kwargs):

from deimos.

zircote avatar zircote commented on June 23, 2024

@solidsnack, thank you. That corrects the issue succinctly, will that be included in a near future version?

from deimos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.