Exemplo n.º 1
0
 def postOptions_bind_mandatory(self):
     if not self.opts["binddn"]:
         raise usage.UsageError("binddn must be given")
Exemplo n.º 2
0
 def postOptions(self):
     if not self['jobdir']:
         raise usage.UsageError('jobdir is required')
Exemplo n.º 3
0
 def postOptions(self):
     super(LeaveOptions, self).postOptions()
     if self["name"] is None:
         raise usage.UsageError(
             "Must specify the --name option"
         )
Exemplo 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('*')
Exemplo 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'
    )
Exemplo 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")
Exemplo 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")
Exemplo n.º 8
0
 def postOptions(self):
     if not self["location"]:
         raise usage.UsageError("--location= is mandatory")
Exemplo 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
Exemplo n.º 10
0
 def postOptions(self):
     if not self["maintainer"]:
         raise usage.UsageError("maintainer must be specified.")
Exemplo 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)
Exemplo 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")
Exemplo 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'])
Exemplo 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")
Exemplo n.º 15
0
 def postOptions(self):
     if not self['basedir']:
         raise usage.UsageError(
             "A base directory for the node must be provided.")
Exemplo 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])
Exemplo n.º 17
0
 def opt_version(self):
     raise usage.UsageError("--version not allowed on subcommands")
Exemplo n.º 18
0
 def postOptions(self):
     if self["suboptions"]:
         self.subOptions = "SubOptionUsage"
     raise usage.UsageError("usage-error-message")
Exemplo n.º 19
0
 def postOptions(self):
     if self['loud']:
         raise usage.UsageError('THIS IS ME BEING LOUD')
Exemplo 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
Exemplo 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
Exemplo n.º 22
0
 def postOptions(self):
     if self['web-port'] is None:
         raise usage.UsageError(
             "Must specify a listening endpoint with --web-port")
Exemplo 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")
Exemplo 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")
Exemplo 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)
Exemplo n.º 26
0
 def parseOptions(self, arguments):
     raise usage.UsageError(expectedMessage)
Exemplo n.º 27
0
 def postOptions(self):
     if self["name"] is None:
         raise usage.UsageError(
             "Must specify the --name option"
         )
Exemplo 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")
Exemplo n.º 29
0
 def postOptions(self):
     if not hasattr(self, 'subOptions'):
         raise usage.UsageError("must specify a subcommand")
Exemplo 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)")