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, self.cfg) pp.create(dbpath) mh = MachineHandler(self.conn) #md = mh.parse_xmlfile(mdbpath) mh.restore_machine_database(path)
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, self.cfg) pp.create(dbpath) 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, self.cfg) pp.main_path = cpath pp.insert_profiles() mh = MachineHandler(self.conn) md = mh.parse_xmlfile(mdbpath) mh.insert_parsed_element(md)