mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
sharing: Simplify --is-public option
Use store_true with default=False to toggle public status based on whether '--is-public' argument is passed or not. Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
9fc8c3604c
commit
654d69a389
3 files changed
+15
-13
No files matched your search
+4
-3
@@ -43,8 +43,9 @@ def parse_arguments():
|
||||
add_parser.add_argument('--path', required=True, help='Disk path to share')
|
||||
add_parser.add_argument('--groups', nargs='*',
|
||||
help='List of groups that can access the share')
|
||||
add_parser.add_argument('--is-public', default=False, required=False,
|
||||
help='1 if public share else 0')
|
||||
add_parser.add_argument('--is-public', required=False, default=False,
|
||||
action="store_true",
|
||||
help='Allow public access to this share')
|
||||
|
||||
remove_parser = subparsers.add_parser('remove',
|
||||
help='Remove an existing share')
|
||||
@@ -94,7 +95,7 @@ def subcommand_add(arguments):
|
||||
aug.set('$conf/Location[last()]/directive[last()]/arg',
|
||||
'includes/freedombox-sharing.conf')
|
||||
|
||||
if is_public != "true":
|
||||
if not is_public:
|
||||
aug.set('$conf/Location[last()]/directive[last() + 1]', 'Include')
|
||||
aug.set('$conf/Location[last()]/directive[last()]/arg',
|
||||
'includes/freedombox-single-sign-on.conf')
|
||||
|
||||
Reference in new issue
Block a user