Commit Graph

38 Commits

Author SHA1 Message Date
wu.chunyang 3b56a5e0f7 kolla-cli: deprecation - Removing project content
step 2b from:
https://docs.openstack.org/project-team-guide/repository.html#step-2b-remove-project-content

Deprecation notice:
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014983.html

Change-Id: I744f5c17232928cec68c1b90b2f5d791faf7d9e7
Depends-On: https://review.opendev.org/748259
2020-09-03 09:58:43 +02:00
jacky06 f87b3fbbb8 Fix some pep8 failed
1. expected 2 blank lines after class or function definition, found 1
2. E117 over-indented

Change-Id: I7ef1a0ffbf200850f350ae6df5fed3ded9b20f90
2020-04-06 10:35:27 +08:00
Zuul 3c78d808e1 Merge "Check passwords.yml exist before init action" 2018-06-20 18:45:23 +00:00
caoyuan 231411e976 Check passwords.yml exist before init action
Change-Id: I6145bf3cc65bbb15eb1426ec5e3dc4e09ada544a
2018-06-20 18:03:19 +00:00
Steve Noyes c6632efa75 Add ability to load inventory from a file
It would be helpful to have the ability to populate the
kolla-cli inventory file from any inventory file, not just the
all-in-one file from kolla.

To do this, The config reset command has been updated to take
an optional --inventory path argument that will cause the new
inventory to be generated from that anible inventory file.

While doing this found a few things to fix:

- renamed allineone.py & AllInOne to AnsibleInventory to better reflect
what they are now doing.

- In kolla_actions, preserve the empty globals.yml file (otherwise
the soft linkage is broken) and fix the kolla-cli directory name.

Change-Id: Ib250c5de8e00818b41c1a4539aba8c165a4ad2e2
2018-06-18 17:28:43 -04:00
Borne Mace e6459aa8f2 Add support for config reset command.
The config reset command wipes all properties,
inventory data, default tls certificates and passwords.
The password set command now only allows modification
of existing passwords, and clear only removes the value
for existing password keys.  The ability to completely
add new and remove passwords no longer exists as it
was really only useful in very edge cases and did not
play nicely with the concept of doing a config reset.

Change-Id: I9d1868da1161ebaf64793ab6d0e42de74389feab
2018-05-25 11:16:02 -07:00
Zuul 010b8929cf Updates to fix py27 / tox tests
Work needed to get the py27 tests to run in the CI.

Implements: blueprint initial-testing

Change-Id: I2375d092c43f6a00e575f303f8e62b969365b149
2018-05-15 11:24:40 -04:00
Borne Mace 78a1fcedf0 Updating the cli to work against kolla-ansible
Pass one at updating the kolla-cli to work against the official
kolla-ansible bits rather than the internal Oracle ones.  There
are some corresponding changes in the kolla-ansible vagrant
scripts related to bringing up the development environment.

Change-Id: Ia680bb65f904c4dbaf3f05d0334145980c860000
Implements: blueprint functional-single-node
2018-04-17 09:45:35 -07:00
Borne Mace c8a5730220 Updated unit tests to avoid remote calls
With the move to a CI/CD environment the tests needed
to be tweaked to not try to make remote calls.  Going
forward any compoud / functional tests that need to
run against remote systems should be broken out into
separate tests that won't be run during our normal
CI/CD flow.

Also fixed flaw in log_collector.py introduced
during recent inventory logic refactoring.

Jira-Issue: OPENSTACK-1710
Change-Id: Id11cc1abcac6ac5b94176a1f17a8f5f82b6f00d5
2017-11-20 10:35:32 -08:00
Steve Noyes 0a98fdb5f7 add new cli/api command to init passwords
Passwords in mitaka kolla are now empty. You have to run a kolla-genpwd
command to init the values. But you have to run that as either root or
kolla, which is not desirable.

This adds a new password command to the cli/api to run that script
for the user so they do not have to change to root or kolla.

Bug 24704089
Jira-Issue: None

Change-Id: I16f60635c94f1f44d0489d20362384ee02caf8b5
2016-09-22 19:25:47 +02:00
Steve Noyes 3f029a7bd4 add ability to cli/api to add/clear ssh keys in password file
- add new password setkey cli command
- add new api password_set_sshkey
- add ability to param checker to not display bad param
- add new change_password util for kolla_actions to call
- update kolla_actions to handle ssh keys
- add utest for setting/clearing ssh keys

Change-Id: I1fedb85d21cd04c222f7250bdda66ad42a9ddca3
Jira-Issue: OPENSTACK-1071
2016-09-20 19:29:44 +02:00
Steve Noyes b6b2018323 add empty password check on deploy
(Bug) 24667619
Jira-Issue: OPENSTACK-1068

Change-Id: I20f3a7b10b2c75eb6e14d2e186d6c933de723bf9
2016-09-16 17:11:18 +02:00
Borne Mace 7a1547aa47 Added support for settings / clearing multiple properties in a single call.
Jira-Issue: OSTACKDEV-19
2016-04-13 12:19:10 -07:00
Steve Noyes 2a9497fd09 add job kill to api
- kolla user must be killer, need to do this from a
sudoer-allowed script
- rename password-editor script to kolla_actions
- update rpm builder to handle rename
- add job kill function to kolla_actions
- add job kill to api
- add utest for kill

Jira-Issue: OSTACKDEV-32
2016-04-07 15:07:16 -04:00
Steve Noyes 9ef934e240 add api for log collecting
- add new support_get_logs() api
- change dump api to require directory for dump to
match new get_logs api
- remove no longer needed pexpect
- update utests
- change log collector tool to use the new api

Jira-Issue: OSTACKDEV-18
2016-04-05 17:41:11 -04:00
Steve Noyes 50967089ec add generic param checker for api
- new method to generically check args
- updated log collector to use API instead of cli

Jira-Issue: OSTACKDEV-18
2016-03-25 16:40:18 -04:00
Steve Noyes 1cdd533d5b Merge branch 'o3l_2.next'
Conflicts:
	kollacli/commands/host.py
	kollacli/common/ansible/actions.py
	kollacli/common/ansible/playbook.py
	kollacli/common/inventory.py
	kollacli/common/utils.py
	tests/deploy.py

Jira-Issue: OSTACKDEV-20
2016-03-18 14:10:45 -04:00
Steve Noyes 1e58e92d5e create apis for deploy, upgrade, host_destroy, host_precheck
- create apis for deploy, upgrade, host_destroy, host_precheck
- change CLI to use new APIs
- create new async api class for job-based apis
- add skeletal upgrade utest
- add some -v and -vv's to utests
- fix newly introduced bug in log_collector
- fix some pep8 warnings

Jira-Issue: OSTACKDEV-20
2016-03-17 16:31:06 -04:00
Steve Noyes 67ef2345d7 WIP - make playbook runs async
- make playbook run return an AnsibleJob object
- rename AnsibleCommand object to AnsibleJob
- provide methods on job to wait,get_status,get_error
- change action to use new async playbook
- fix newly introduced bug in safe_decode
- fix bug in shell where errors were outputted twice
- provide new inventory method to remove temp inventory dir/file
- fix removal of inventory dir/file in log collector
- change debug logging default to False in the callback module

Jira-Issue: OSTACKDEV-20
2016-03-17 12:54:25 -04:00
Steve Noyes a15db48689 Better handling of unicode in log collector.
Jira-Issue: OPENSTACK-697
2016-03-15 17:24:44 -04:00
Steve Noyes 4e9d9da384 fix getting logs on ovm servers
Jira-Issue: OPENSTACK-677
2016-03-02 14:54:46 -08:00
Steve Noyes b8c543424e fix getting logs on ovm servers
Jira-Issue: OPENSTACK-677
2016-03-01 12:57:12 -05:00
Steve Noyes 3b0fd1a549 update copyrights to 2016
Jira-Issue: OPENSTACK-642
2016-02-15 09:41:14 -08:00
Steve Noyes 92d9037179 update log_collector tool for 2.1.1
- fix imports in log collector tool
- add new unit test for it
- move dump test to new support test module
- can no longer import pxssh after upgrade to pexpect 4.0.1, change to
  import from pexpect module
- fix a couple of pep8 issues

Jira-Issue: OPENSTACK-297
2016-02-15 09:41:14 -08:00
Steve Noyes ceff841d65 remove oslo utils dependency
Jira-Issue: OPENSTACK-560

do safe decode and encode in utils.
2016-02-15 09:41:13 -08:00
Steve Noyes dae53cabc8 restructuring of directories to separate cli from common code
- add new commands directory under kollacli for cli commands
- split misc commands into support and deploy
- clean up imports
- move sshutils and utils under common directory
2015-11-24 15:12:20 -05:00
Steve Noyes 0136c27410 dump bug fixes
- dump was still using the obsolete json_generator. replace that with the
dynamically generated json inventory file
- a few other fixes in dump
- file checking added to dump unittest
- capture error output in log collector when no output is received
2015-11-10 15:03:20 -05:00
Steve Noyes 4691834f7d py3 (6) - update log_collector.py to py3 compatibility 2015-11-09 17:49:59 -05:00
Steve Noyes 23860d1491 remove obsolete json_generator 2015-10-26 15:37:22 -04:00
Steve Noyes f68397d7e1 synchronize access to files to avoid corruption
- add new read and write file methods to synchronous accesss to files to avoid simultaneous reads and writes.
- fix issue with pexpect prompt change in last check-in. caused deploy to fail in some cases.
synchronize access to files to avoid corruption
- better errors on ansible playbook errors
2015-10-19 08:38:11 -04:00
Steve Noyes d167270be6 change json generator to be a generated file
- json generator will be generated on the fly for deploy
- new inventory method create_json_gen_file to create dynamic
json generator file
- updated and new unit tests to test dynamic inventory filtering
- TODO: delete json generator file. Needed for now to pass unit tests
2015-10-14 15:04:19 -04:00
Steve Noyes 320d401942 update log collector to add kollacli dump output file 2015-10-12 14:51:42 -04:00
Steve Noyes 6082d05e98 add ability to inventory class to generate ansible json to specific groups or hosts
- use yml file to pass groups/hosts filter to json generator
- update json generation to apply deploy hosts and groups
- misc fixup of some unit tests
2015-10-12 14:08:27 -04:00
Steve Noyes e0fdb99141 fix bug 21960307 - when deleting a group, remove association from all services.
- when deleting a group, remove association from all services
- add test for this bug
- add docker ps output to log collection
2015-10-07 14:21:43 -04:00
Steve Noyes 6b7f805d9f add log_collector tool 2015-10-01 13:11:03 -04:00
Steve Noyes 3da95342ab add set/clear/list passwords cli commands
- add set/clear/list password commands
- update passwd_editor script to perform a password list
- add new password unittest

Still todo:
- package script properly into rpm with appropriate restrictive permissions
2015-09-16 11:33:29 -04:00
Steve Noyes 15b2ab00b0 add script to modify passwords file
- add new script that will edit the passwords.yml file. The script will be called from the cli
so that the passwords file can be set up to be only edited by this script. Users will not
be able to have access to the passwords file directly.
- moved change_property from ansible/property to utils so it can be used by the script.

Still to do:
- hook script into a cli command
- package script properly into rpm with appropriate restrictive permissions
- add password key list
2015-09-15 17:12:44 -04:00
Steve Noyes 88d401684a remove zones, move json gen to tools dir 2015-08-20 16:54:35 -04:00