Gandi / gandi.cli

⚠ ARCHIVED - Command line interface to Gandi.net products using the public API
http://cli.gandi.net/
GNU General Public License v3.0
347 stars 62 forks source link

[domain list] - Invalid API key, please use 'gandi setup' command. #311

Closed fccagou closed 3 years ago

fccagou commented 3 years ago

Hello

I just have installed gandi using venv and pip then create an api key on v5 web interface at https://account.gandi.net/en/users/MYACCOUNT/security

User python 3.9.1 from ArchLinux

$ python --version
$ Python 3.9.1

Install python venv

$ python -m venv gandi-cli
$ . gandi-cli/bin/activate
(gandi-cli) $ pip install gandi.cli
...

Chek installed cli

(gandi-cli) $ gandi --version
Gandi CLI 1.6
Copyright: © 2014-2018 Gandi S.A.S.
License: GPL-3

(gandi-cli)  $ gandi api 
API version: 3.3.37

Run setup

(gandi-cli) $  gandi setup
Welcome to GandiCLI, let's configure a few things before we start.

Api key (xmlrpc) [...]: xxxxxxxxxxxxxxxxxxxxxxxxxxx
Environnment [production]/ote (ote, production): 
SSH keyfile [~/.ssh/id_rsa.pub]: ~/.ssh/id_rsa.pub
Api key (REST) [...]: xxxxxxxxxxxxxxxxxxxxxxxxxx

Setup completed. You can now:
* use 'gandi' to see all command.
* use 'gandi vm create' to create and access a Virtual Machine.
* use 'gandi paas create' to create and access a SimpleHosting instance.

Test cli

(gandi-cli) $  gandi domain list
Invalid API key, please use 'gandi setup' command.

Conf file

(gandi-cli)  $ cat  ~/.config/gandi/config.yaml
api:
    host: https://rpc.gandi.net/xmlrpc/
    key: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
apirest:
    key: xxxxxxxxxxxxxxxxxxxxxxxxxxxx
sshkey:
- /home/fccagou/.ssh/id_rsa.pub

gandi dns list works fine.

So, XMLRPC doesn't work while RESTapi works.

s0nik42 commented 3 years ago

same problem for me using pip install a few hours ago.

fccagou commented 3 years ago

After reading all issues, the problem is the same then the ones described in #255 and #279. The PR #310 seems in progress to correct the issues.