Esempio n. 1
0
 def postOptions_bind_mandatory(self):
     if not self.opts["binddn"]:
         raise usage.UsageError("binddn must be given")
Esempio n. 2
0
 def postOptions(self):
     if not self['jobdir']:
         raise usage.UsageError('jobdir is required')
Esempio n. 3
0
 def postOptions(self):
     super(LeaveOptions, self).postOptions()
     if self["name"] is None:
         raise usage.UsageError(
             "Must specify the --name option"
         )
Esempio n. 4
0
 def opt_allow_ignore_ext(self):
     """Specify whether or not a request for 'foo' should return 'foo.ext'"""
     if not isinstance(self['root'], static.File):
         raise usage.UsageError("You can only use --allow_ignore_ext "
                                "after --path.")
     self['root'].ignoreExt('*')
Esempio n. 5
0
def mamba_services_not_found():
    raise usage.UsageError(
        'error: make sure you are inside a mamba application root directory '
        'and then run this command again'
    )
Esempio n. 6
0
 def parseArgs(self, *nodedirs):
     from allmydata.util.encodingutil import argv_to_abspath
     self.nodedirs = map(argv_to_abspath, nodedirs)
     if not nodedirs:
         raise usage.UsageError("must specify at least one node directory")
Esempio n. 7
0
 def postOptions(self):
     if self["umask"] is None:
         self["umask"] = get_umask()
     if not self["location"]:
         raise usage.UsageError("--location= is mandatory")
Esempio n. 8
0
 def postOptions(self):
     if not self["location"]:
         raise usage.UsageError("--location= is mandatory")
Esempio n. 9
0
 def opt_timestamps(self, arg):
     if arg not in FORMAT_TIME_MODES:
         raise usage.UsageError("--timestamps= must be one of (%s)" %
                                ", ".join(FORMAT_TIME_MODES))
     self["timestamps"] = arg
Esempio n. 10
0
 def postOptions(self):
     if not self["maintainer"]:
         raise usage.UsageError("maintainer must be specified.")
Esempio n. 11
0
    if config['quiet']:
        stdout = StringIO()

    so.stdout = stdout
    so.stderr = stderr
    so.stdin = stdin

    if command in create_dispatch:
        rc = create_dispatch[command](so, stdout, stderr)
    elif command in startstop_node.dispatch:
        rc = startstop_node.dispatch[command](so, stdout, stderr)
    elif command in debug.dispatch:
        rc = debug.dispatch[command](so)
    elif command in cli.dispatch:
        rc = cli.dispatch[command](so)
    elif command in ac_dispatch:
        rc = ac_dispatch[command](so, stdout, stderr)
    else:
        raise usage.UsageError()

    return rc


def run(install_node_control=True):
    if sys.platform == "win32":
        from allmydata.windows.fixups import initialize
        initialize()

    rc = runner(sys.argv[1:], install_node_control=install_node_control)
    sys.exit(rc)
Esempio n. 12
0
 def postOptions(self):
     MakerBase.postOptions(self)
     self['usepty'] = int(self['usepty'])
     self['keepalive'] = int(self['keepalive'])
     if self['master'].find(":") == -1:
         raise usage.UsageError("--master must be in the form host:portnum")
Esempio n. 13
0
 def postOptions(self):
     if self['basedir'] is None:
         raise usage.UsageError("<basedir> parameter is required")
     self['basedir'] = os.path.abspath(self['basedir'])
Esempio n. 14
0
 def postOptions_base(self):
     # check that some things are given
     if self.opts["base"] is None:
         raise usage.UsageError("base must be given")
Esempio n. 15
0
 def postOptions(self):
     if not self['basedir']:
         raise usage.UsageError(
             "A base directory for the node must be provided.")
Esempio n. 16
0
 def parseArgs(self, *args):
     if len(args) < 2:
         raise usage.UsageError("cp requires at least two arguments")
     self.sources = map(argv_to_unicode, args[:-1])
     self.destination = argv_to_unicode(args[-1])
Esempio n. 17
0
 def opt_version(self):
     raise usage.UsageError("--version not allowed on subcommands")
Esempio n. 18
0
 def postOptions(self):
     if self["suboptions"]:
         self.subOptions = "SubOptionUsage"
     raise usage.UsageError("usage-error-message")
Esempio n. 19
0
 def postOptions(self):
     if self['loud']:
         raise usage.UsageError('THIS IS ME BEING LOUD')
Esempio n. 20
0
 def postOptions(self):
     if not hasattr(self, 'subOptions'):
         raise usage.UsageError("must specify a subcommand")
     # ensure our node-directory is valid
     _ = self.node_directory
Esempio n. 21
0
 def opt_mime_type(self, defaultType):
     """Specify the default mime-type for static files."""
     if not isinstance(self['root'], static.File):
         raise usage.UsageError(
             "You can only use --mime_type after --path.")
     self['root'].defaultType = defaultType
Esempio n. 22
0
 def postOptions(self):
     if self['web-port'] is None:
         raise usage.UsageError(
             "Must specify a listening endpoint with --web-port")
Esempio n. 23
0
 def postOptions(self):
     if self['https']:
         try:
             from twisted.internet.ssl import DefaultOpenSSLContextFactory
         except ImportError:
             raise usage.UsageError("SSL support not installed")
Esempio n. 24
0
 def parseArgs(self, *args):
     if len(args) > 0:
         self['master'] = args[0]
     if len(args) > 1:
         raise usage.UsageError("I wasn't expecting so many arguments")
Esempio n. 25
0
 def postOptions(self):
     if not hasattr(self, 'subOptions'):
         if not hasattr(self, 'no_command_needed'):
             raise usage.UsageError("must specify a command")
         sys.exit(0)
Esempio n. 26
0
 def parseOptions(self, arguments):
     raise usage.UsageError(expectedMessage)
Esempio n. 27
0
 def postOptions(self):
     if self["name"] is None:
         raise usage.UsageError(
             "Must specify the --name option"
         )
Esempio n. 28
0
 def postOptions(self):
     if self['telnetPort'] is None and self['sshPort'] is None:
         raise usage.UsageError(
             "At least one of --telnetPort and --sshPort must be specified")
Esempio n. 29
0
 def postOptions(self):
     if not hasattr(self, 'subOptions'):
         raise usage.UsageError("must specify a subcommand")
Esempio n. 30
0
 def postOptions(self):
     if not self['local-ivo'] and (self['broadcast'] or self['receive']):
         raise usage.UsageError("IVOA identifier required (--local-ivo)")