Commit Graph

40 Commits

Author SHA1 Message Date
Dmitry Tantsur 3621535d67 Stop requiring checksums with file images
Neither deploy method requires checksums with file images, they're
simply ignored. Deprecate providing them.

Change-Id: Ia123c1d3c57cc2814e3f971209cbee3ab336f7bd
2020-09-03 14:23:52 +02:00
Zuul 9aeaa29f5d Merge "Get rid of testtools and fixtures" 2020-05-06 16:21:56 +00:00
Dmitry Tantsur 954a6cab6d Start enforcing W504 in pep8
Apparently, not disabling W503 results in W504 ignored. The latter
seems to be preferred now.

Change-Id: I53124ff7b4083382dc24f32fe9affe6fc7478281
2020-05-04 11:27:57 +02:00
Dmitry Tantsur 90671a01e3 Get rid of testtools and fixtures
testtools was used to provide a smoother transition to Python 3.
fixtures seems no longer actively maintained and is mostly redundant.

Change-Id: I3fff3beafca13a783bcb4d5a811099ad491ac7ac
2020-05-04 11:19:58 +02:00
Sean McGinnis f6fb359cf5
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I97af946c244559513689c1ea9ac2d736d55dbe0f
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 16:05:36 -05:00
Iury Gregory Melo Ferreira c765bbe8a8 Stop using six library
Since we've dropped support for Python 2.7, it's time to look at
the bright future that Python 3.x will bring and stop forcing
compatibility with older versions.
This patch removes the six library from requirements, not
looking back.

Change-Id: I19384db89fc2a68376efc3f9f2e05fbd05046fd6
2019-12-03 15:15:20 +01:00
Dmitry Tantsur 24d006b996 Bring formatting in line with other OpenStack CLI
Change-Id: Ifb299d5d95245e8848785eb2e2a7018fbb4129d6
2019-07-22 15:01:15 +02:00
Dmitry Tantsur 349e5074e3 Split InstanceConfig into GenericConfig and CloudInitConfig
As a side effect allows providing custom user data, not only users.

Change-Id: Ia4c305ea996b3bb58c5898777cc7a3c8b93a413d
2019-05-24 15:18:18 +02:00
Dmitry Tantsur 4920cc26a3 Allow disabling clean up on deployment failure
Change-Id: Iaa9e7ec1c2cd2b71047388e51255ec69d52d6a83
2019-05-17 14:13:10 +02:00
Dmitry Tantsur 9be7472236 Accept hostname in reserve_node in addition to provision_node
With the allocation API we will need to provide the hostname as
the allocation name. Thus, we have to do it earlier.

Change-Id: I8afd8af23ad929fd9768e95a82fecd114fdcbfd9
2019-03-15 14:49:58 +01:00
Dmitry Tantsur 2aeb60434e Display hostname in the default formatter
Change-Id: If6021ee5449cf74159640fdcc3f248c9f99a4105
2019-02-20 14:32:43 +01:00
Dmitry Tantsur 02932096df Clean up the edge cases around states
Currently show_instance returns an Instance even if the requested node
is not actually an instance (e.g. just an available node). This change
corrects it. Make list_instances consistent with it.

Also make the states a proper enum to avoid consumers from using invalid
values (I did it several times when working on this patch).

Change-Id: If9aad0d7f4d10a7119d1f0bccc1cc32a918a72e3
2019-01-18 17:49:01 +01:00
Dmitry Tantsur 47e9e9319d Support specifying a subnet for NIC
This may be required in case of routed networks as an alternative
to specifying a fixed_ip.

Change-Id: I8187f950cb961f60131af8b07fb54eee69019dbc
2019-01-16 16:27:02 +01:00
Dmitry Tantsur 8263ca2c2e Add sources.detect to detect various source types
Change-Id: Ic1e325538f0975b04750e10233e877ffcfbf4263
2019-01-16 12:40:50 +01:00
Dmitry Tantsur eee74d31b8 Completely switch to openstacksdk
Change-Id: I1729797fa03095d200c7334281915abc284b5732
2019-01-15 10:24:52 +01:00
Dmitry Tantsur 47fe222b6d Accept optional fixed_ip for nics
Covers a popular case of nodes having a pre-defined IP.

Also moves NICs code to a separate module for clarity.

Change-Id: Id8272cc30728ca68e7ce2efd4f3a2f9887ef7449
Story: #2002171
Task: #26340
2018-09-14 16:59:11 +02:00
Dmitry Tantsur 98ad1d86cd Wire in file image support
Change-Id: If729c8cde28186dc28ec994ddd23c981c9313fe2
Story: #2002048
Task: #26380
2018-09-12 12:42:03 +02:00
Dmitry Tantsur fc85cb9230 Support partition HTTP images in CLI
Also removed some dead code from sources.

Change-Id: I570eda45285771068711ef90d22550632411e98f
Story: #2002048
Task: #26208
2018-09-12 10:13:33 +02:00
Dmitry Tantsur 2afd20938d Support creating a swap partition
BREAKING: --root-disk-size => --root-size

Story: #2002171
Task: #20033
Change-Id: I5d6b38e1a9e71b608b40e140e34c4509b896a1ff
2018-09-10 17:00:41 +02:00
Dmitry Tantsur df831309ba Support traits for scheduling
Story: #2003685
Task: #26209
Change-Id: I4895c414abc55ece6cf56133f13ffaa7cd4f5f92
2018-09-07 16:57:57 +02:00
Dmitry Tantsur 6bdd479773 Support for HTTP image location
Story: #2002048
Task: #19695
Change-Id: I75f33ebca3ea65274dcfcd8f4ddbd193f34706a9
2018-09-07 10:04:38 +02:00
Dmitry Tantsur a638cec066 Allow filtering by arbitrary predicate and conductor_group
BREAKING: changed order of arguments in reserve_node.

BREAKING: changed exceptions inheriting ReservationFailed.

Change-Id: I79cc9b2794d8332cdb818af0b7effb28d4e9a786
Story: #2003584
Task: #24890
2018-09-05 12:25:11 +02:00
Dmitry Tantsur d20abe3c79 Implement list_instances and `metalsmith list`
Change-Id: I51f83fcebf665be8b290774433fbf1da5108ec27
Story: #2003585
Task: #24891
2018-08-29 12:02:24 +02:00
Dmitry Tantsur 5aacd7bbdb Allow specifying a list of nodes to pick from
Makes resource class no longer mandatory.

Change-Id: If14d5846e7b50a867950ae439985bbe877998bc7
Story: #2002171
Task: #20034
2018-07-05 19:54:57 +02:00
Dmitry Tantsur cbf7294be9 ansible: split waiting from provisioning
Introduces a new command 'wait' for this purpose.

Change-Id: I52ef0228cce2be276046b93c284743c4067da0a6
Story: #2002186
Task: #20058
2018-07-03 15:26:16 +02:00
Dmitry Tantsur e2085dc026 Support creating users via configdrive
Change-Id: I93259ccd98d4153f1ed370541e2208124ddb0ca1
2018-06-29 16:33:17 +02:00
Dmitry Tantsur 703bddb775 Pass in InstanceConfig instead of ssh_keys
Change-Id: I7b313174896917d583bf8356207abf57ea08a197
2018-06-22 17:12:16 +02:00
Dmitry Tantsur 72995b1117 Rename image_ref -> image and get_image_info -> get_image
Change-Id: I85c2967935f9394b424beb1d79682700e41de1bf
2018-06-21 13:24:07 +02:00
Zuul 4ce8342ea5 Merge "Move Instance to its own file" 2018-06-18 17:38:58 +00:00
Dmitry Tantsur 7b3561bb9a Move Instance to its own file
Change-Id: I607b804f719e2a660c2e52a672b68b9281af4569
2018-06-18 17:01:24 +02:00
Dmitry Tantsur 675fa04dda CLI: use --resource-class instead of a positional argument
Change-Id: Ic0808253a6c417ae9de71c24606375d998946630
2018-06-18 16:20:27 +02:00
Dmitry Tantsur 320144a73e Add command and function to show instances
Story: #2002170
Task: #20027
Change-Id: I78991f75ea45ea61553d75301117c77a16ea8885
2018-06-08 16:38:46 +02:00
Dmitry Tantsur 1cda22151d Support custom hostnames
Story: #2002170
Task: #20036
Change-Id: Ida169c96128459b22e495ca92d454dd3f08f7eb3
2018-06-08 15:42:26 +02:00
Dmitry Tantsur 22361ce9d1 Move logging IP addresses to the CLI itself
Add Instance.ip_addresses for similar use cases.

Change-Id: I1e788e507783f69b1970ab8eca5994aff9f0ea12
2018-05-29 15:30:28 +02:00
Dmitry Tantsur b55ba7e2f5 Add output formatters for CLI commands
Change-Id: I712e597856617acf13cc33e0ad2aa757326ff9f5
2018-05-29 13:04:13 +02:00
Dmitry Tantsur f3fb73a5a8 Add --verbose CLI argument to fine-tune verbosity
Adjust logging based on local testing with different levels.

Change-Id: Iecf083bc0a9c4779a6a263173ffb46150a5ca434
2018-05-28 14:48:21 +02:00
Dmitry Tantsur 18fbeab747 Unlock the node before deleting it in unprovisioning and default to not waiting
Cleaning can take a lot of time, we should not generally wait for it.

Change-Id: I6781b123dba933628210dec9f61967a305df2da5
2018-05-22 10:40:52 +02:00
Dmitry Tantsur 1037276d61 Allow attaching existing ports
Also fix cleaning up node.extra and undeployment.

Change-Id: Ic63b3663caea4eb9acd9d8f48008785dec2a62d3
2018-05-17 15:51:26 +02:00
Dmitry Tantsur 87a053a5aa Use openstack.config for arguments parsing
This change switches the CLI to use openstacksdk for populating
authentication arguments and creating a session. As a side effect,
using clouds.yaml is now supported and used in the CI.

Change-Id: If20ddc46f10d9deb34e595310313bd87e2e7243b
2018-05-16 13:37:29 +02:00
Dmitry Tantsur 9f1b7755fc Grand refactor to split out reusable bits 2018-05-08 21:32:14 +02:00