Esempio n. 1
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument(
         'filename',
         help='OS file path where the data to import from or export to')
     parser.add_argument('-i',
                         '--import-data',
                         action='store_true',
                         help='Import data')
     parser.add_argument('-f',
                         '--format',
                         choices=['json', 'yaml'],
                         help='Input/output file format',
                         default='yaml')
     parser.add_argument('-p',
                         '--full-path',
                         action='store_true',
                         help='Add full OMS paths (export-only)',
                         default=False)
     parser.add_argument('-m',
                         '--max-depth',
                         type=int,
                         help='Max path recursion depth',
                         default=5)
     parser.add_argument('-a',
                         '--attributes',
                         type=list,
                         help='List of attributes to import/export',
                         default=[])
     return parser
Esempio n. 2
0
    def arguments(self):
        parser = VirtualConsoleArgumentParser()
        parser.add_argument('paths', nargs='+')
        parser.add_argument('-R',
                            '--recursive',
                            action='store_true',
                            help='Apply permissions recursively')

        group = parser.add_mutually_exclusive_group(required=True)
        group.add_argument(
            '-i',
            '--inherit',
            action='store_true',
            help='Set object to inherit permissions from its parent(s)',
            default=False)
        group.add_argument(
            '-m',
            action='append',
            help="add an Allow ace: {u:[user]:permspec|g:[group]:permspec}")
        group.add_argument(
            '-d',
            action='append',
            help="add an Deny ace: {u:[user]:permspec|g:[group]:permspec}")
        group.add_argument(
            '-x',
            action='append',
            help="remove an ace: {u:[user]:permspec|g:[group]:permspec}")
        return parser
Esempio n. 3
0
    def arguments(self):
        parser = VirtualConsoleArgumentParser()
        parser.add_argument(
            'paths',
            nargs='+',
            help='Prototype template to be used to find all similar ones')

        group = parser.add_mutually_exclusive_group(required=True)
        group.add_argument(
            '-i',
            action='store_true',
            help='Set object to inherit permissions from its parent(s)',
            default=False)
        group.add_argument(
            '-m',
            action='append',
            help="add an Allow ace: {u:[user]:permspec|g:[group]:permspec}")
        group.add_argument(
            '-d',
            action='append',
            help="add an Deny ace: {u:[user]:permspec|g:[group]:permspec}")
        group.add_argument(
            '-x',
            action='append',
            help="remove an ace: {u:[user]:permspec|g:[group]:permspec}")

        return parser
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument(
         '-v',
         '--verbose',
         action='count',
         help="be verbose, use it multiple times to increase verbosity")
     return parser
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     choices = [i.name for i in (yield self._commands())]
     parser.add_argument('command',
                         nargs='?',
                         choices=choices,
                         help="command to get help for")
     defer.returnValue(parser)
Esempio n. 6
0
 def arguments(self):
     p = VirtualConsoleArgumentParser()
     principals = map(lambda p: p.id, effective_principals(self.user))
     if 'admins' in principals:
         p.add_argument('-u',
                        '--user',
                        help='Check user by name (admins only)')
     return p
Esempio n. 7
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('-f',
                         '--full',
                         action='store_true',
                         help='Perform full sync',
                         default=False)
     return parser
Esempio n. 8
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('-d',
                         '--deactivated',
                         action='store_true',
                         default=False,
                         help="Set deactivated state")
     return parser
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('-n', help='Number of lines to output')
     parser.add_argument('-u',
                         action='store_true',
                         required=False,
                         default=False,
                         help='Display user log')
     return parser
Esempio n. 10
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('dest_path')
     parser.add_argument(
         '-o',
         '--offline',
         action='store_true',
         default=False,
         help="Force offline migration, shutdown VM before migrating")
     return parser
Esempio n. 11
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('path', nargs='?')
     parser.add_argument(
         '-P',
         action='store_true',
         help=
         "use physical directory structure instead of following symbolic links"
     )
     return parser
Esempio n. 12
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('tid', nargs='*', help="Task id")
     parser.add_argument('-STOP',
                         action='store_true',
                         help="Pauses the task")
     parser.add_argument('-CONT',
                         action='store_true',
                         help="Unpauses the task")
     return parser
Esempio n. 13
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('paths', nargs='+')
     parser.add_argument('-v',
                         action='store_true',
                         help='Show grants for every permission')
     parser.add_argument('-R',
                         '--recursive',
                         action='store_true',
                         help='Print permissions recursively')
     return parser
Esempio n. 14
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('paths', nargs='+')
     parser.add_argument('-o', action='append')
     parser.add_argument('-H', action='store_true')
     parser.add_argument(
         '-l',
         action='store_true',
         default=False,
         help='Show each item of a collection property on its own line')
     return parser
Esempio n. 15
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('-s',
                         action='store_true',
                         help="ignored, as we only have symbolic links")
     parser.add_argument('-f',
                         action='store_true',
                         help="Force, delete destination if exists")
     parser.add_argument('src')
     parser.add_argument('dst')
     return parser
Esempio n. 16
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('-f',
                         '--free',
                         action='store_true',
                         help='Mark IP as free')
     parser.add_argument('-u',
                         '--use',
                         action='store_true',
                         help='Mark IP as used')
     parser.add_argument('ip')
     return parser
Esempio n. 17
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('-l', action='store_true', help="long")
     parser.add_argument('-R', action='store_true', help="recursive")
     parser.add_argument(
         '-d',
         action='store_true',
         help=
         "list directory entries instead of contents, and do not dereference "
         "symbolic links")
     parser.add_argument('paths', nargs='*')
     return parser
Esempio n. 18
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('password')
     parser.add_argument('-u',
                         help='User name',
                         required=False,
                         default=None)
     parser.add_argument('-g',
                         help="group(s): comma separated list of "
                         "groups the user belongs to",
                         required=False,
                         default=None)
     return parser
Esempio n. 19
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('-t',
                         action='store_true',
                         help='Force tracking changes')
     parser.add_argument('-s', help='Show details for particular types')
     parser.add_argument('-d',
                         action='store_true',
                         help='Step into debugger')
     parser.add_argument('-b',
                         action='store_true',
                         help='Step into debugger in DB thread')
     return parser
Esempio n. 20
0
    def arguments(self):
        parser = VirtualConsoleArgumentParser()
        parser.add_argument('path')

        group = parser.add_mutually_exclusive_group(required=True)
        group.add_argument(
            '-p',
            action='store_true',
            help="Show effective permissions for a given object")
        group.add_argument(
            '-r',
            action=MergeListAction,
            help="Check if the user has some rights on a given object")
        return parser
Esempio n. 21
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument(
         'bsd',
         nargs='*',
         help=
         "Ignored bsd args, for those who have unix type habits (e.g. 'ps xa')"
     )
     parser.add_argument('-d',
                         action='store_true',
                         help="Show recently finished (dead) tasks.")
     parser.add_argument('-l',
                         action='store_true',
                         help="Show parent task id")
     return parser
Esempio n. 22
0
    def arguments(self):
        parser = VirtualConsoleArgumentParser()

        obj = self.current_obj

        choices = []
        if getattr(obj, '__contains__', None):
            for name, cls in creatable_models.items():
                if obj.can_contain(cls):
                    choices.append(name)

        parser.add_argument('type',
                            choices=choices,
                            help="object type to be created")
        return parser
Esempio n. 23
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('user', help='User name')
     parser.add_argument('paths', nargs='+', help='List of paths')
     parser.add_argument('-R',
                         '--recursive',
                         action='store_true',
                         help='Change ownership recursively',
                         default=False,
                         required=False)
     parser.add_argument('-l',
                         '--limit',
                         type=int,
                         default=5,
                         help='Recursion limit (default=5)')
     parser.add_argument('-v',
                         '--verbose',
                         action='store_true',
                         help='Display console warnings about '
                         'transient objects')
     return parser
 def setUp(self):
     self.terminal = mock.Mock()
     self.parser = VirtualConsoleArgumentParser(file=self.terminal)
Esempio n. 25
0
 def arguments(self):
     return VirtualConsoleArgumentParser()
Esempio n. 26
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('seconds')
     return parser
Esempio n. 27
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('name')
     parser.add_argument('value')
     return parser
Esempio n. 28
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('strings', nargs='*')
     return parser
Esempio n. 29
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('paths', nargs='+')
     return parser
Esempio n. 30
0
 def arguments(self):
     parser = VirtualConsoleArgumentParser()
     parser.add_argument('paths', nargs='+')
     parser.add_argument('-f', action='store_true')
     return parser