Revert "ooooo"

This reverts commit 2f0e802d5a.
This commit is contained in:
Grigouze 2018-12-23 18:35:48 +01:00
parent fcd9c6915f
commit e7ec85edba
14 changed files with 50 additions and 52 deletions

View file

@ -272,10 +272,10 @@ def export(gandi, resource, output, force, intermediate):
@certificate.command()
@click.option('--csr', required=False,
help='Csr of the new certificate (filename or content).')
@click.option('--private-key', '--pk', required=False,
@click.option('--pk', '--private-key', required=False,
help='Private key to use to generate the CSR (filename or '
'content).')
@click.option('--common-name', '--cn', required=False,
@click.option('--cn', '--common-name', required=False,
help='Common name to use when generating the CSR.')
@click.option('--country', required=False,
help='The generated CSR country (C).')
@ -368,17 +368,17 @@ def create(gandi, csr, private_key, common_name, country, state, city,
@certificate.command()
@click.argument('resource', nargs=1, required=True)
@click.option('--csr', help='New csr for the certificate.', required=False)
@click.option('--private-key', '--pk', required=False,
@click.option('--pk', '--private-key', required=False,
help='Private key to use to generate the CSR.')
@click.option('--country', '--c', required=False,
@click.option('--c', '--country', required=False,
help='The generated CSR country (C).')
@click.option('--state', '--st', required=False,
@click.option('--st', '--state', required=False,
help='The generated CSR state (ST).')
@click.option('--city', '--l', required=False,
@click.option('--l', '--city', required=False,
help='The generated CSR location (L).')
@click.option('--organisation', '--o', required=False,
@click.option('--o', '--organisation', required=False,
help='The generated CSR organisation (O).')
@click.option('--branch', '--ou', required=False,
@click.option('--ou', '--branch', required=False,
help='The generated CSR branch (OU).')
@click.option('--altnames', required=False, multiple=True,
help='All the certificate altnames (comma separated text '
@ -511,7 +511,7 @@ def resend_dcv(gandi, resource):
@certificate.command()
@click.argument('resource', nargs=1, required=True)
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'

View file

@ -87,11 +87,11 @@ def info(gandi, resource):
@certstore.command()
@click.option('--private-key', '--pk', required=True,
@click.option('--pk', '--private-key', required=True,
help='Private key used to generate this CRT.')
@click.option('--certificate', '--crt', required=False,
@click.option('--crt', '--certificate', required=False,
help='The certificate.')
@click.option('--certificate-id', '--crt-id', type=click.INT, required=False,
@click.option('--crt-id', '--certificate-id', type=click.INT, required=False,
help='The certificate.')
@pass_gandi
def create(gandi, private_key, certificate, certificate_id):

View file

@ -112,7 +112,7 @@ def info(gandi, resource):
@disk.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
@ -139,7 +139,7 @@ def detach(gandi, resource, background, force):
@disk.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('-r', '--read-only', default=False, is_flag=True,
help='Attach disk as read-only')
@ -197,7 +197,7 @@ def attach(gandi, disk, vm, position, read_only, background, force):
default=None, type=SNAPSHOTPROFILE_VM)
@click.option('--delete-snapshotprofile', default=False, is_flag=True,
help='Remove snapshot profile associated to this disk.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@pass_gandi
@click.argument('resource')
@ -233,7 +233,7 @@ def update(gandi, resource, cmdline, kernel, name, size,
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
' without prompting. (default=False).')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='run command in background mode (default=False).')
@click.argument('resource', nargs=-1, required=True)
@pass_gandi
@ -274,7 +274,7 @@ def delete(gandi, resource, force, background):
help='Create a disk from a disk or a snapshot.')
@option('--datacenter', type=DATACENTER, default='FR-SD5',
help='Datacenter where the disk will be created.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@pass_gandi
def create(gandi, name, vm, size, snapshotprofile, datacenter, source,
@ -312,7 +312,7 @@ def create(gandi, name, vm, size, snapshotprofile, datacenter, source,
@disk.command()
@click.option('--name', type=click.STRING, default=None,
help='Snapshot name, will be generated if not provided.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('resource')
@pass_gandi
@ -331,7 +331,7 @@ def snapshot(gandi, name, resource, background):
@disk.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('resource', required=True)
@pass_gandi
@ -345,7 +345,7 @@ def rollback(gandi, resource, background):
@disk.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'

View file

@ -67,7 +67,7 @@ def info(gandi, resource):
@click.option('--extra_parameter', default=None, nargs=2,
type=(unicode, unicode),
help='Extra parameters', multiple=True)
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('resource', metavar='DOMAIN', required=False)
@pass_gandi
@ -101,7 +101,7 @@ def create(gandi, resource, domain, duration, owner, admin, tech, bill,
@click.option('--duration', default=1, prompt=True,
type=click.IntRange(min=1, max=10),
help='Registration period in years, between 1 and 10.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('domain')
@pass_gandi

View file

@ -113,7 +113,7 @@ def info(gandi, resource):
@ip.command()
@click.argument('ip')
@click.option('--reverse', help='Update reverse (PTR record) for this IP')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@pass_gandi
def update(gandi, ip, reverse, background):
@ -126,7 +126,7 @@ def update(gandi, ip, reverse, background):
@ip.command()
@click.argument('ip')
@click.argument('vm')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
@ -171,7 +171,7 @@ def attach(gandi, ip, vm, background, force):
@click.option('--vlan', help='The vlan to which attach this ip if any.')
@click.option('--ip', help='The ip if you try to create a private ip.')
@click.option('--attach', help='The vm you want to attach if any.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@pass_gandi
def create(gandi, datacenter, bandwidth, ip_version, vlan, ip, attach,
@ -211,7 +211,7 @@ def create(gandi, datacenter, bandwidth, ip_version, vlan, ip, attach,
@ip.command()
@click.argument('resource')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
@ -233,7 +233,7 @@ def detach(gandi, resource, background, force):
@ip.command()
@click.argument('resource', nargs=-1, required=True)
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'

View file

@ -128,7 +128,7 @@ def update(gandi, email, password, quota, fallback, alias_add, alias_del):
@mail.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'

View file

@ -135,7 +135,7 @@ def deploy(gandi, remote, branch):
@paas.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
@ -192,14 +192,14 @@ def delete(gandi, background, force, resource):
@click.option('--vhosts', default=None,
help='Virtual host(s) to be linked to the instance.')
@click.option('--ssl', help='Get ssl on that vhost.', is_flag=True)
@click.option('--private-key', '--pk',
@click.option('--pk', '--private-key',
help='Private key used to generate the ssl Certificate.')
@click.option('--poll-cert', help='Will wait for the certificate creation.',
is_flag=True)
@click.option('--password', help='Use command-line supplied password.')
@click.option('--snapshotprofile', default=None, type=SNAPSHOTPROFILE_PAAS,
help='Set a snapshot profile associated to this paas disk.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@option('--sshkey', multiple=True,
help='Authorize ssh authentication for the given ssh key.')
@ -269,7 +269,7 @@ def create(gandi, name, size, type, quantity, duration, datacenter, vhosts,
help='Set a snapshot profile associated to this paas disk.')
@click.option('--reset-mysql-password', default=None,
help='Reset mysql password for root.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--delete-snapshotprofile', default=False, is_flag=True,
help='Remove a snapshot profile associated to this paas disk.')
@ -306,7 +306,7 @@ def update(gandi, resource, name, size, quantity, password, sshkey,
@paas.command()
@click.argument('resource', nargs=-1, required=True)
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'

View file

@ -83,13 +83,13 @@ def info(gandi, resource, id):
@click.option('--paas', required=True,
help='PaaS instance on which to create it.')
@click.option('--ssl', help='Get ssl on that vhost.', is_flag=True)
@click.option('--private-key', '--pk',
@click.option('--pk', '--private-key',
help='Private key used to generate the ssl Certificate.')
@click.option('--alter-zone', help='Will update the domain zone.',
is_flag=True)
@click.option('--poll-cert', help='Will wait for the certificate creation.',
is_flag=True)
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('vhost', required=True)
@pass_gandi
@ -110,7 +110,7 @@ def create(gandi, vhost, paas, ssl, private_key, alter_zone, poll_cert,
@vhost.command()
@click.option('--ssl', help='Get ssl on that vhost.', is_flag=True)
@click.option('--private-key', '--pk',
@click.option('--pk', '--private-key',
help='Private key used to generate the ssl Certificate.')
@click.option('--poll-cert', help='Will wait for the certificate creation.',
is_flag=True)
@ -128,7 +128,7 @@ def update(gandi, resource, ssl, private_key, poll_cert):
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
' without prompting. (default=False).')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('resource', required=True)
@pass_gandi

View file

@ -94,7 +94,7 @@ def info(gandi, resource, ip):
@vlan.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
@ -138,7 +138,7 @@ def delete(gandi, background, force, resource):
help='Datacenter where the vlan will be spawned.')
@click.option('--subnet', help='The vlan subnet.')
@click.option('--gateway', help='The vlan gateway.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@pass_gandi
def create(gandi, name, datacenter, subnet, gateway, background):

View file

@ -100,7 +100,7 @@ def info(gandi, resource, stat):
@vm.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('resource', nargs=-1, required=True)
@pass_gandi
@ -121,7 +121,7 @@ def stop(gandi, background, resource):
@vm.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('resource', nargs=-1, required=True)
@pass_gandi
@ -142,7 +142,7 @@ def start(gandi, background, resource):
@vm.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.argument('resource', nargs=-1, required=True)
@pass_gandi
@ -163,7 +163,7 @@ def reboot(gandi, background, resource):
@vm.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'
@ -243,7 +243,7 @@ def delete(gandi, background, force, resource):
'This command will run with root privileges in the ``/`` '
'directory at the end of its boot: network interfaces and '
'disks are mounted.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@option('--sshkey', multiple=True,
help='Authorize ssh authentication for the given ssh key.')
@ -355,7 +355,7 @@ def create(gandi, datacenter, memory, cores, ip_version, bandwidth, login,
@click.option('--password', default=False, is_flag=True,
help='Will ask for a password to be set for the root account '
'and the created login.')
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--reboot', default=False, is_flag=True,
help='Accept a VM reboot for non-live updates')
@ -513,7 +513,7 @@ def datacenters(gandi, id):
@vm.command()
@click.option('--background', '--bg', default=False, is_flag=True,
@click.option('--bg', '--background', default=False, is_flag=True,
help='Run command in background mode (default=False).')
@click.option('--force', '-f', is_flag=True,
help='This is a dangerous option that will cause CLI to continue'

View file

@ -138,7 +138,7 @@ def info(gandi, resource, format):
@click.option('--vhost', '-v', help="Vhost to add in the webaccelerator",
multiple=True)
@click.option('--ssl', help='Get ssl on that vhost.', is_flag=True)
@click.option('--private-key', '--pk',
@click.option('--pk', '--private-key',
help='Private key used to generate the ssl Certificate.')
@click.option('--poll-cert', help='Will wait for the certificate creation.',
is_flag=True)
@ -244,7 +244,7 @@ def delete(gandi, webacc, vhost, backend, port):
@click.option('--vhost', '-v', help="Add vhosts in the webaccelerator",
multiple=True)
@click.option('--ssl', help='Get ssl on that vhost.', is_flag=True)
@click.option('--private-key', '--pk',
@click.option('--pk', '--private-key',
help='Private key used to generate the ssl Certificate.')
@click.option('--poll-cert', help='Will wait for the certificate creation.',
is_flag=True)

View file

@ -187,7 +187,6 @@ class SnapshotParamType(GandiChoice):
""" Initialize choices list. """
self._choices = []
self.target = target
self.case_sensitive = None
def _get_choices(self, gandi):
""" Internal method to get choices list """

View file

@ -199,9 +199,8 @@ ssh 185290@console.dc2.gpaas.net""")
self.assertEqual(result.output, """\
Usage: clone [OPTIONS] NAME
Try "clone --help" for help.
Error: Missing argument "NAME".
Error: Missing argument "name".
""")
self.assertEqual(result.exit_code, 2)

View file

@ -41,7 +41,7 @@ with open(os.path.join(here, 'gandi', 'cli', '__init__.py')) as v_file:
version = re.compile(r".*__version__ = '(.*?)'",
re.S).match(v_file.read()).group(1)
requires = ['setuptools', 'pyyaml', 'click>=6.7', 'requests', 'IPy']
requires = ['setuptools', 'pyyaml', 'click>=3.1, <6.7', 'requests', 'IPy']
tests_require = ['pytest', 'pytest-cov', 'tox']
if sys.version_info < (2, 7):