Example #1
0
 def cmd_create(self, args):
     r = Repo(type=args.type, root=args.directory, name=args.name, key=args.key, config=self.config)
     if args.chunkfile:
         r.save(args.chunkfile, state=False)
     if args.add:
         r.save_state()
         self.repos[r.uuid] = r
         r.start()
     return {"status": "ok"}
Example #2
0
    def cmd_add(self, args):
        chunkfile = os.path.abspath(args.chunkfile)
        if not os.path.exists(chunkfile):
            raise Exception("Chunkfile %s does not exist" % chunkfile)

        r = Repo(filename=chunkfile, root=args.directory, name=args.name, key=args.key, config=self.config)
        r.save_state()
        self.repos[r.uuid] = r
        r.start()
        return {"status": "ok"}