Commits

Vladimir Mihailenco  committed fc23fc9

Fix cpu_count and os_codename

  • Participants
  • Parent commits 0e2a089

Comments (0)

Files changed (2)

File fabdeploy/containers.py

     @conf
     def os(self):
         from fabdeploy import system
-        self.set_globally('os', system.os_codename.codename())
+        with system.os_codename.tmp_conf():
+            self.set_globally('os', system.os_codename.codename())
         return self.os
 
     @conf
     def cpu_count(self):
         from fabdeploy import system
-        self.set_globally('cpu_count', system.cpu_count.cpu_count())
+        with system.cpu_count.tmp_conf():
+            self.set_globally('cpu_count', system.cpu_count.cpu_count())
         return self.cpu_count
 
     def config_template_lpath(self, name):

File fabdeploy/system.py

     def code(self):
         return 'import multiprocessing; print(multiprocessing.cpu_count())'
 
+    def cpu_count(self):
+        return self.exe()
+
     def do(self):
-        cpu_count = self.exe()
+        cpu_count = self.cpu_count()
         puts('Number of CPUs: %s' % cpu_count)
 
 cpu_count = CpuCount()