52 Commits

Author SHA1 Message Date
Pengju Jiao
254e609cff Fix guess auth version error
Currently, the guess auth version in freezer client
is not correct, because opts.os_identity_api_version
has never been initialized. This patch will fix it.

Change-Id: Ie5ff077213956a48dcd13c75b6855be7402d253c
Closes-Bug: #1715539
2017-09-07 12:32:07 +08:00
Pengju Jiao
85c5496e1d Fix creating freezer client with keystone auth session
Change-Id: I66e360ed36616a79bac24aca7ea364a0ed5aabe8
Closes-Bug: #1709608
2017-08-09 19:53:01 +08:00
Saad Zaher
35dffdf231 Set OS_BACKUP_API_VERSION to v1
Setting OS_BACKUP_API_VERSION defaults to 1 as the api v2 is not
stable yet.

Change-Id: Icf5b4e310955306b6a42ef1f51fad1957e71d26a
2017-06-30 14:47:12 +01:00
Memo Garcia
bb19aa5b4d Freezerclient v2
Freezer client now has the ability to talk to v2 api endpoint

if you are using BaaS please use:
OS_BACKUP_API_VERSION=2
otherwise
OS_BACKUP_API_VERSION=1

Change-Id: I93715e18f96c35b7952f3aeac3cb05b56313f9a9
2017-06-28 14:27:45 +01:00
Pengju Jiao
52751fd173 Fix 'freezer client-delete' error
Currently, execute command 'freezer client-delete' to
delete a client will be failed with error "Namespace
object has no attribute 'client_uuid'", this patch
will fix it.

Change-Id: Ia2b56643c528327711e162e9e15b65ab1cf357bb
Closes-Bug: #1677572
2017-03-30 19:45:10 +08:00
Sravan Kumar Dommaraju
9a79f84108 Fix freezer client-* output
What's new:
* while running client-list and client-show, uuid is getting none
  modified the code to get correct uuid.

Change-Id: I629cdb1bb4bbabdd7e74b86f949cec44fb40e984
Closes-Bug: #1676264
2017-03-24 01:56:26 +05:30
Jenkins
80871f9efd Merge "Enable project_id for multi-domain support" 2017-03-08 10:19:33 +00:00
Jenkins
1fba07e28e Merge "Deletion of backup metadata" 2017-03-08 10:17:48 +00:00
Jenkins
e1652c7968 Merge "client-id is now required when creating jobs" 2017-03-08 10:16:23 +00:00
Memo Garcia
7064261b35 Enable project_id for multi-domain support
Change-Id: I377d45fdfc1a685859fcf031b1483a72898ae309
2017-03-07 16:13:09 +00:00
Memo Garcia
5c5a39cb0b Deletion of backup metadata
Change-Id: I636bd891a01a6e8e3c06059888cac6c3dad244da
2017-03-07 10:40:58 +00:00
Memo Garcia
85a7cdd7a6 client-id is now required when creating jobs
Change-Id: I6598ac3a14935c9b00efa4315b74b95d73781999
2017-03-07 10:31:34 +00:00
Memo Garcia
6a582b15e1 Displaying job status
Change-Id: I677f4b398cc2aad8cf53bf9abbd86001bb49cab8
2017-03-06 14:03:39 +00:00
Memo Garcia
5e88395416 Enable client deletion
Change-Id: Id190b7e8adee822e398a6bb204277bde23893419
2017-03-03 17:53:11 +00:00
Pierre-Arthur MATHIEU
9ea12f01d0 Update message for job start/stop/abort
Change-Id: Ifda3dd6390415a9203abf47395894ee307174aa2
2017-03-01 14:54:02 +00:00
Saad Zaher
37b49b1a35 Added session-start option to allow starting sessions
Change-Id: Ic7b2110c7cbcb19bba7681da7aa2307594445dba
2017-02-17 15:52:48 +00:00
Saad Zaher
1c801df90b Fix SSL connections initiated from freezer-scheduler
Change-Id: I703b0fd18f9463fe03cdea37c6405d3043e5662f
2017-02-14 19:15:18 +00:00
Saad Zaher
879694b196 Fix ssl connections
Change-Id: I7a1dce63346247bbbd2f73711e110f4713580933
2017-02-13 15:35:10 +00:00
Jenkins
454a30e772 Merge "Add Keystone V3 OS_USER_DOMAIN_ID and OS_PROJECT_DOMAIN_ID" 2017-01-25 20:45:28 +00:00
yangyapeng
2bb71175b1 Add Keystone V3 OS_USER_DOMAIN_ID and OS_PROJECT_DOMAIN_ID
Add OS_USER_DOMAIN_ID and OS_PROJECT_DOMAIN_ID for get keystone
token.

Change-Id: Icdbbc16a59e52c1485075565f159856f4c26c275
Closes-Bug: #1652581
2016-12-26 15:44:25 +08:00
KATO Tomoyuki
d79f44e970 Print version information dynamically
Change-Id: I10c135eb7378a30b44d24b58be3904ff000f0421
2016-12-21 23:01:49 +09:00
Jenkins
1197ce06b4 Merge "Fix freezer backup support" 2016-12-14 08:58:04 +00:00
Jenkins
5f646ce5b4 Merge "The --file parameter should be changed to required" 2016-12-07 17:43:51 +00:00
Ruslan Aliev
985a82eaef Fix freezer backup support
Since backup_id is UUID in freezer-api, there is need to change some methods:
1. Removed workaround to get backup data and use standart API call get()
2. Fixed backup-list and backup-show output according to new backup structure
3. Added backup-delete feature based on backup_id query

Change-Id: I62f312ec3a0a56f5f2e6f8915023b34f87fa42de
Closes-Bug: #1646575
Closes-Bug: #1642151
Depends-On: I50ae24b11b58bcea3d2c9f117957300a926cd3ab
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-12-05 20:04:06 +04:00
Ruslan Aliev
6010f1cbe8 Add full pep8 check
This patch adds almost full pep8 check including unit test code.
All code style problems is solved.

Change-Id: Ie9b31b2ecfafc22fc299d749ca45ce69fdc64472
Closes-Bug: #1645342
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-12-05 19:01:26 +04:00
Shangzhong Zhu
d42f568557 The --file parameter should be changed to required
Executing freezer action-create, job-create or session-create without
--file parameter causes NoneType error. The --file parameter should be
changed to required.

Change-Id: I7dcbe4ff2109d4ca1bac79604c918f79f522daa8
Closes-Bug: #1642126
2016-12-01 15:05:06 +00:00
Jenkins
2500e1e572 Merge "Fixed "End Date" and "Interval" error" 2016-12-01 14:26:42 +00:00
Jenkins
b07af2beb6 Merge "Change --session-id and --job-id to required" 2016-12-01 14:26:20 +00:00
Shangzhong Zhu
4bd0952d66 Change --session-id and --job-id to required
Executing freezer session-add-job or session-remove-job without
any parameter causes error. The --session-id and --job-id parameter
should be changed to required.

Change-Id: Ie2e1d058526fd6a219be0179b8311f38ed16ef72
Closes-Bug: #1642130
2016-11-29 22:00:35 +00:00
Shangzhong Zhu
c51c9daf2e Fixed "End Date" and "Interval" error
Closes-Bug: #1643826
Change-Id: I5b21f79db8fe15cf242c8f2f8ffc288f5ed3d4d9
Signed-off-by: Shangzhong Zhu <zhu.shangzhong@zte.com.cn>
2016-11-29 21:59:15 +00:00
Ruslan Aliev
0d4c316ea8 Add session-delete command
Added session-delete action, for unknown reasons it was missed.

Change-Id: I45070e90cbdc366d3f1264b24e0a329532e5ff99
Closes-Bug: #1641993
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-11-22 21:02:20 +03:00
Ruslan Aliev
35d67b6a4f freezer session-* improvements
List of improvements:
* Fixed bug with freezer complete command. The root cause of
  this problem was not implemented methods get_parser in
  classes SessionStart and SessionDelete.
* Actions session-start and session-end and appropriate classes
  was removed due to this actions are not called by user, it's
  triggered by freezer-scheduler directly [1].
* Action session-list now prints empty table if no sessions
  found.
* Import objects replaced on import modules

[1]85ab97121e/freezer/scheduler/scheduler_job.py (L432)

Change-Id: I49933fd77d858fa0e07849889678de9703a4824e
Closes-Bug: #1640761
Closes-Bug: #1641991
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-11-22 20:50:03 +03:00
Shangzhong Zhu
0968fdf606 Achieve a consistent style output
When the list is empty, the different style output is being used for
the freezer action-list, backup-list, job-list, session-list and
client-list.

Achieve a consistent style output for these commands in this patch.

Change-Id: I17f65fc3a836357f2c4857b4e5f7de7c8e8fb116
Closes-Bug: #1642101
2016-11-19 15:07:54 +08:00
Shangzhong Zhu
d71101139b Import objects replaced by modules
Change-Id: If22b5968983537187f3a4a5515b7a3f173eb168b
Closes-Bug: #1641864
2016-11-15 16:38:54 +08:00
Jenkins
121f837dd8 Merge "Fix freezer client-* output" 2016-11-14 12:27:16 +00:00
Jenkins
70c6a844a5 Merge "Fix freezer client-register prompt" 2016-11-14 10:51:23 +00:00
Ruslan Aliev
e6a8863956 Fix freezer client-* output
What's new:
* Print empty table if no clients found
* Check that client exists before delete,
  print message if no clients with ID was found
* Import objects replaced by modules
* Some code refactored

Change-Id: I076afbcda21b1f1ca7a85d733f7fc7204487b25e
Closes-Bug: #1641184
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-11-11 21:02:10 +03:00
Ruslan Aliev
35cc6f404f Fix freezer client-register prompt
Executing freezer client-register without --file parameter
causes NoneType error during open file. This patch fixes it
by changing --file parameter to required.

Change-Id: I3cd6112187aa6c2a5dee2489078968b04567f4a9
Closes-Bug: #1634766
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-11-09 21:26:12 +03:00
Ruslan Aliev
c96526ff5d Fix freezer CLI output
There is a problem with executing CLI commands:
no endpoint type was provided during creating keystone
client object. This patch fixes it.
Also, there are some small changes:
* moving from keystoneclient to keystoneauth1
* fixed import order, replaced import objects
* supressed output from requests lib due to info messages in output
(Starting new HTTP connection (1))

Change-Id: I57c42877c94d6d5706a7b6bf1e154f29704f9783
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2016-11-09 21:11:06 +03:00
Jenkins
51d88728fe Merge "Using assertEqual instead of assertEquals" 2016-10-17 15:13:25 +00:00
Jenkins
59c2473306 Merge "Docstrings should not start with a space" 2016-10-17 15:04:24 +00:00
Anh Tran
1ca5bd4694 Using assertEqual instead of assertEquals
This's defined in H234:
http://docs.openstack.org/developer/hacking/#python-3-x-compatibility

Change-Id: I917b09ac4c868eee5cd937c115d6c0913d219eea
2016-10-17 14:59:01 +00:00
Saad Zaher
9c7ff3a7fd Fixed python-freezerclient insecure option
Change-Id: I00efeb74e3c3c236a0e05d8743581f6c9812b713
Closes-Bug: #1634136
2016-10-17 13:26:31 +00:00
Jenkins
ccb4d05fbd Merge "Fixed set values for opts argument" 2016-10-17 09:40:12 +00:00
Memo Garcia
0a0f24f940 Filter jobs by client and/or custom filters
Closes-bug: 1562015
Change-Id: Ib887226c53d747ae36bef0dea7ade6a7a5e37531
2016-10-06 10:37:13 +00:00
Cao Xuan Hoang
5a77cd49bd Docstrings should not start with a space
As per OpenStack Docstrings guide lines [1]:
[H401] Docstrings should not start with a space.
[H403] Multi line docstrings should end on a new line.
[H404] Multi line docstrings should start without a leading new line.
[H405] Multi line docstrings should start with a one line summary
followed by an empty line.

[1] http://docs.openstack.org/developer/hacking/#docstrings

trivialfix

Change-Id: Ifbc123eec81f47f833f93e5a51f34e385767162e
2016-09-28 11:34:23 +07:00
Saad Zaher
05da0f9fdb Force python-freezerclient to send Accept in headers
We need to support sending accept to make sure the returning response
will be json formated. This is needed as we interact with different
Openstack components which support xml, json format and default is xml

Change-Id: I07db838de4aa6c50b357a5ca32e0a1ecc41c720b
Implements: blueprint python-freezerclient-to-accept-json-header
2016-07-19 08:08:07 +00:00
Memo Garcia
d6d388a7a2 Fixed set values for opts argument
Closes-bug: 1597285
Change-Id: Ia05516303973b232498a08dcfb8dc6b9de652d2c
2016-06-29 14:51:55 +01:00
Memo Garcia
63accdeac5 Enforce content-type in request headers
Implements Blueprint: contenttype
Change-Id: I7b407d29952090d88a4cd5900a814f651ffdf348
2016-06-05 22:09:48 +00:00
Memo Garcia
bb9871106d Fixed client creation when no os_backup_url is given
Closes-bug: 1585274
Change-Id: I7d3945b9f3c76c4042715b518ba5018d8e20f6bd
2016-06-01 11:17:47 +01:00