Example #1
0
File: crm_gv.py Project: lge/crmsh
 def image(self, img_type, outf):
     if not config.core.dot:
         common_err("dot not found")
         return False
     dotf = self.totmpf()
     if not dotf:
         return False
     tmpfiles.add(dotf)
     return (utils.ext_cmd_nosudo("%s -T%s -o%s %s" %
                                  (config.core.dot, img_type, outf, dotf)) == 0)
Example #2
0
 def image(self, img_type, outf):
     if not config.core.dot:
         common_err("dot not found")
         return False
     dotf = self.totmpf()
     if not dotf:
         return False
     tmpfiles.add(dotf)
     return (utils.ext_cmd_nosudo(
         "%s -T%s -o%s %s" % (config.core.dot, img_type, outf, dotf)) == 0)
Example #3
0
 def _load_cib(self, source):
     if source == "live":
         if not self.backing_file:
             self.backing_file = xmlutil.cibdump2tmp()
             if not self.backing_file:
                 return None
             tmpfiles.add(self.backing_file)
         else:
             xmlutil.cibdump2file(self.backing_file)
         f = self.backing_file
     else:
         f = cib_path(source)
     return xmlutil.read_cib(xmlutil.file2cib_elem, f)
Example #4
0
 def _load_cib(self, source):
     if source == "live":
         if not self.backing_file:
             self.backing_file = xmlutil.cibdump2tmp()
             if not self.backing_file:
                 return None
             tmpfiles.add(self.backing_file)
         else:
             xmlutil.cibdump2file(self.backing_file)
         f = self.backing_file
     else:
         f = cib_path(source)
     return xmlutil.read_cib(xmlutil.file2cib_elem, f)