28 Commits

Author SHA1 Message Date
Pradeep Kumar Singh
28715147df Solve some py3 compatibilty issues
1. replaced dict.keys() with six.iterkeys(dict)
2. replaced map with six.moves.map

Change-Id: I4b80e12a4686fd6f5857c2322de13b1245e72083
2015-07-24 02:35:55 +00:00
Federico Ceratto
649519d875 Log error message from EndpointNotFound exceptions
Change-Id: I1e87cea22d08c6591934ff79953e5adbd27e0064
Closes-Bug: 1268310
2015-07-06 15:43:48 +01:00
Jenkins
d42bf25000 Merge "Allow relative names in record-create" 2015-06-08 14:35:43 +00:00
Jenkins
39801cf94d Merge "Log a more informative error upon EndpointNotFound" 2015-05-26 17:09:17 +00:00
Davide Guerri
34d14b06d9 Move all_tenants and edit_managed attributes to designate Client
Initializing designate client with a pre-existing keystone session
won't work as designate expects keystone session to have the
'all_tenants' and 'edit_managed' attributes:

Example code:

    keystone_session = ksc_session.Session(
      auth=keystone_auth,
      verify=True,
      cert=my_cert
    )

than later:

    self._designate_client = designate_client(
      session=keystone_session,
      region_name=region_name
    )

with that code, wrap_api_call() will raise an exception:

  AttributeError: 'Session' object has no attribute 'all_tenants'

Same goes for 'edit_managed'.

This patch moves both attributes from Keystone session to designate
Client.

Closes-Bug: 1457821
Change-Id: I13d6c9ed46406fefc8cfa5de46811e4be009f1af
2015-05-22 13:40:52 +00:00
Endre Karlson
a6577e297f Log a more informative error upon EndpointNotFound
Change-Id: I2e3886a66ae57e810db1b5b4cb197bc7b8c157ed
2015-05-21 14:58:03 +02:00
Cedric Brandily
1349227339 Allow relative names in record-create
Currently record-create requires absolute names. This change allows to
provide relative (to the domain) names with the new option --relative.

Change-Id: I78258ea734a4105fae8f9f3ef30fe86e018b5388
Closes-Bug: #1444452
2015-05-04 21:03:30 +02:00
Cedric Brandily
4f586cb060 Allow to use domain names instead of ids
Currently designate allows to identify a resource only by its id. This
change allows to identify domains by name or id. This change defines
the method find_resourceid_by_name_or_id which could be reused to
identify other resources by name or id.

Change-Id: I8e64cdbc5572623d05781d0c4e735ff0c429ea91
Closes-Bug: #1443858
2015-04-14 15:52:34 +00:00
Endre Karlson
e0e428acaf Fix if checking on ttl for Create/Update commands
Change-Id: I13412fee6c71b00cd5e4bc2ca8c2074cc01fc6d0
2015-01-29 15:07:09 +01:00
Endre Karlson
04f627647f Move session creation up to shell
Change-Id: I65d3f37f60f97240b52b0234da6160121ec292e1
2014-11-13 14:28:06 +01:00
rjrjr
e23e51b5cd sync and touch Commands Extend the base.DeleteCommand
To allow the sync-all, sync-domain, sync-record, and touch-domain commands
to display errors correctly, the classes for these commands now extend the
base.DeleteCommand instead of the base.Command.

The base.Command has no formatter.

The base.DeleteCommand has the ShowOne formatter and does not show any
messages when the command is successful, but shows errors when there is
a failure.

Change-Id: I92ca95f167fec9fb36880024e6c84284186126df
Closes-Bug: #1357092
2014-08-14 17:06:17 -07:00
Endre Karlson
322c455cdc Add support for quotas for v1 cli / bindings
Change-Id: Id89fff58e1975fa84ae12a44ac2fd43cd2255b52
2014-08-01 10:44:53 +02:00
Jenkins
975bc5418d Merge "Support Keystone V3 authentication" 2014-07-11 12:15:28 +00:00
Christian Berendt
8af71e9bde Enabled hacking check H401
* [H401] Docstrings should not start with a space.

Change-Id: I1fa248590c7e05ab92b30ae30af1cf107cdd3cc4
2014-07-10 21:55:14 +02:00
Kiall Mac Innes
11425c0d01 Support Keystone V3 authentication
We now defer the majority of our auth to keystoneclient, rather
than continuing to maintain our custom code.

Change-Id: Ia8409940d3941bc82a8b54ec60e82efa6d043102
Closes-Bug: 1323435
2014-07-07 22:44:36 +02:00
Jordan Cazamias
9d4544fd51 Update hacking package, fix/ignore new style errors
Change-Id: I49d26c3a9772c409b038b06e8256fb5823169c50
Implements: blueprint update-hacking
2014-07-01 17:14:26 -05:00
Christian Berendt
d6bca95537 Use six.add_metaclass instead of __metaclass__
According to http://docs.openstack.org/developer/hacking/ it should
be preferred to use six.add_metaclass instead of __metaclass__.

Added new requirement six >= 1.6.0.

Change-Id: Ic7e4f5cb03889cc6bfdb04a657d4654b5fedc985
2014-06-06 12:16:54 +01:00
Marcus Furlong
6025437b65 designate record-list should display record data
designate record-list currently only displays id, type and name. It would be
very useful if the actual data was also displayed, as running a record-get on
each id to obtain this information is very time-consuming.

This patch improves the output so that it is in the following format:

+--------------------------------------+------+-----------------------------+--------------+
| id                                   | type | name                        | data         |
+--------------------------------------+------+-----------------------------+--------------+
| 8a6b789b-71bc-43b6-91eb-9a0790ee1052 | A    | netapp-c1.rc.nectar.org.au. | 172.22.20.71 |
| aa609885-3f8d-4ed6-9de4-3204448281e1 | A    | netapp-c2.rc.nectar.org.au. | 172.22.20.72 |
+--------------------------------------+------+-----------------------------+--------------+

Change-Id: I9ca85b64505d3331fd0bd458c31163cc243e7b34
Closes-Bug: #1308414
2014-04-16 19:08:13 +10:00
Shane Wang
3f43747a72 Fix misspellings in python designateclient
Fix misspellings detected by:
* pip install misspellings
* git ls-files | grep -v locale | misspellings -f -

Change-Id: Ib47acd8a5e4b1b733e1d75b8995a14620f2c9627
Closes-Bug: #1257295
2014-02-08 08:53:04 +08:00
Dirk Mueller
109ea08546 Fix and enable gating on H306
H306, module imports should be in alphabetical order
This hacking check actually improves readability quite
a bit, as module imports can be sorted in groups (python stdlibs,
external imports, in-module imports)

Change-Id: I11dc9155fbfc84389f2a5956f393f705388f83ba
2013-12-16 15:41:51 +01:00
Kiall Mac Innes
8de6241201 Add touch-domain to CLI
Change-Id: I369051e7d7ba2c0819835dada3a13e54798a63ad
2013-11-12 14:36:13 +00:00
Kiall Mac Innes
c0c6e59a17 Move "sync" commands out of Diagnostics and fix them
This mirrors the layout on the server side.

I don't consider this a breaking change, as the existing sync commands were broken
to begin with.

Change-Id: Id80e148e2a0218d6bd64673bb09c15ab0d98418b
2013-11-12 14:36:09 +00:00
Graham Hayes
e2d7dc2c5c Added domain and record description editing
Change-Id: I8cdf3b9fa986255a9c1787f4ed8375bded8ee062
Closes-Bug: 1213889
2013-10-30 18:41:06 +00:00
Kiall Mac Innes
6714726520 Ensure TTL is treated as an int in the CLI
Change-Id: Icd6e56adb416946af98bcc1dd1fbbe16c2aef8c8
2013-10-27 14:52:29 +00:00
Kiall Mac Innes
e405cb3f44 Ensure Invalid JSON and errors during deletes are displayed correctly
Change-Id: Iccd4ee10611cfa58a98618f29545d5b194edafa3
2013-10-14 12:45:19 +01:00
Kiall Mac Innes
5fe58dac71 Add a --insecure arg to ignore invalid SSL certs
Change-Id: I7350c2f9d8f857300784955b2b776f3f1dc69933
2013-09-18 12:55:40 +01:00
Dirk Mueller
f7bc95a871 Use Python 3.x compatible except construct.
Python 3.x deprecated the form "except x,y:". Switch usage to
"except x as y:", which works with any Python version >= 2.6

Change-Id: Id276fdaee9e8753568227e638408e5bccff28e67
2013-09-04 14:41:29 +02:00
Kiall Mac Innes
67c14f0573 Rename Moniker -> Designate
Change-Id: Idf7153aa287adc874a2878dc829950fda52a4879
2013-06-09 22:08:11 +01:00