1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-28 08:46:56 +00:00

Remove sub command "init". Stores are now auto-created

This commit is contained in:
Jonas Borgström 2011-07-02 19:46:41 +02:00
parent e8ed99f300
commit b608bf71db
3 changed files with 2 additions and 13 deletions

View file

@ -41,15 +41,11 @@ def print_verbose(self, msg, *args, **kw):
else:
print msg,
def do_init(self, args):
self.open_store(args.store, create=True)
return self.exit_code
def do_serve(self, args):
return StoreServer().serve()
def do_create(self, args):
store = self.open_store(args.archive)
store = self.open_store(args.archive, create=True)
keychain = Keychain(args.keychain)
try:
Archive(store, keychain, args.archive.archive)
@ -234,12 +230,6 @@ def run(self, args=None):
subparser = subparsers.add_parser('change-password')
subparser.set_defaults(func=self.do_keychain_chpass)
subparser = subparsers.add_parser('init')
subparser.set_defaults(func=self.do_init)
subparser.add_argument('store', metavar='STORE',
type=location_validator(archive=False),
help='Store to initialize')
subparser = subparsers.add_parser('serve')
subparser.set_defaults(func=self.do_serve)

View file

@ -32,7 +32,7 @@ class DoesNotExist(KeyError):
def __init__(self, path, create=False):
self.txn_active = False
if create:
if not os.path.exists(path) and create:
self.create(path)
self.open(path)

View file

@ -30,7 +30,6 @@ def setUp(self):
self.keychain = '/tmp/_test_dedupstore.keychain'
if not os.path.exists(self.keychain):
self.darc('init-keychain')
self.darc('init', self.store_path)
def tearDown(self):
shutil.rmtree(self.tmpdir)