Update mirror argument parsing to work with Django 1.8.
This commit is contained in:
@@ -212,14 +212,23 @@ class IndexFS(Operations):
|
|||||||
class Command(management.BaseCommand):
|
class Command(management.BaseCommand):
|
||||||
help = 'Mount an index as a FUSE filesystem.'
|
help = 'Mount an index as a FUSE filesystem.'
|
||||||
usage_str = 'Usage: ./manage.py mountindex [index slug] [mount point]'
|
usage_str = 'Usage: ./manage.py mountindex [index slug] [mount point]'
|
||||||
args = '[index slug] [mount point]'
|
#args = '[index slug] [mount point]'
|
||||||
|
|
||||||
|
def add_arguments(self, parser):
|
||||||
|
parser.add_argument('slug', nargs='?',
|
||||||
|
help='Index slug'
|
||||||
|
)
|
||||||
|
|
||||||
|
parser.add_argument('mount_point', nargs='?',
|
||||||
|
help='Mount point'
|
||||||
|
)
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
if len(args) != 2:
|
if not options.get('slug') or not options.get('mount_point'):
|
||||||
print('Incorrect number of arguments')
|
print('Incorrect number of arguments')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
FUSE(
|
FUSE(
|
||||||
operations=IndexFS(index_slug=args[0]), mountpoint=args[1],
|
operations=IndexFS(index_slug=options['slug']),
|
||||||
nothreads=True, foreground=True
|
mountpoint=options['mount_point'], nothreads=True, foreground=True
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user