Beispiel #1
0
 def restore(self, path):
     if not os.path.isdir(path):
         raise Error, 'arguement needs to be a directory'
     dbpath = join(path, 'database.xml')
     mdbpath = join(path, 'machine_database.xml')
     pp = PaellaProcessor(self.conn)
     pp.create(dbpath)
     mh = MachineHandler(self.conn)
     md = mh.parse_xmlfile(mdbpath)
     mh.insert_parsed_element(md)
 def restore(self, path):
     if not os.path.isdir(path):
         raise Error, 'arguement needs to be a directory'
     dbpath = join(path, 'database.xml')
     mdbpath = join(path, 'machine_database.xml')
     pp = PaellaProcessor(self.conn)
     pp.create(dbpath)
     mh = MachineHandler(self.conn)
     md = mh.parse_xmlfile(mdbpath)
     mh.insert_parsed_element(md)    
Beispiel #3
0
 def import_client(self, client):
     cpath, ppath, fpath, tpath = self._cpaths_(client)
     profiles, families, traits = self._client_schema(client)
     mdbpath = join(cpath, 'machine_database.xml')
     if families:
         f = Family(self.conn)
         f.import_families(fpath)
     if profiles:
         pp = PaellaProcessor(self.conn)
         pp.main_path = cpath
         pp.insert_profiles()
     mh = MachineHandler(self.conn)
     md = mh.parse_xmlfile(mdbpath)
     mh.insert_parsed_element(md)
 def import_client(self, client):
     cpath, ppath, fpath, tpath = self._cpaths_(client)
     profiles, families, traits = self._client_schema(client)
     mdbpath = join(cpath, 'machine_database.xml')
     if families:
         f = Family(self.conn)
         f.import_families(fpath)
     if profiles:
         pp = PaellaProcessor(self.conn)
         pp.main_path = cpath
         pp.insert_profiles()
     mh = MachineHandler(self.conn)
     md = mh.parse_xmlfile(mdbpath)
     mh.insert_parsed_element(md)