Commit Graph

131 Commits

Author SHA1 Message Date
tikitavi 32740781f6 kernel_id and ramdisk_id parameters are not supported in novaclient create
remove them from ec2api

Signed-off-by: tikitavi <rtikitavi@gmail.com>
Change-Id: I0e647be2d3f1500b14deed72a64728a42a33db34
2023-06-23 14:09:56 +03:00
xuanyandong 44f22cf2a5 Remove six
Replace the following items with Python 3 style code.

- six.PY2
- six.text_type
- six.string_type
- six.binary_type
- six.iterkeys
- six.moves
- six.itervalues

Implements: blueprint six-removal

Change-Id: I6195ceeeed2ebe1586973eaeef7fa9f29698fec2
2022-07-05 17:37:44 +08:00
Andrey Pavlov fce377c0ba handle new volume's status "reserved"
cinder introduced a new status 'reserved' for volume.
It means that volume has reserved for attaching.
Cause AWS doesn't know such status then we need to convert
it to status 'attaching'.

Change-Id: I84ee29eefc8a9db3982c61820e2cf72a56946132
2017-12-23 15:53:29 +00:00
tikitavi 907de91b55 turn on disable_ec2_classic in devstack installation
fix problem with incorrect creation of default vpc from metadata

Change-Id: If84c4cc1b7ec5664ff194cecb64b8f85ba4ca844
2017-06-15 14:58:52 +03:00
Jenkins 140af4ae7b Merge "Remove log translations" 2017-05-25 14:41:17 +00:00
tikitavi 20f65fac2d fix ec2-api after deprecation of nova-network functions in novaclient
removed NovaEngine in addresses, availability_zones, instances, security_groups
removed unit tests for NovaEngine
disabled some unit tests using NovaEngine for further reworking

Closes-bug: #1691484
Change-Id: I662d5b57b9e46be80c1d2093038ada83897565eb
2017-05-24 20:00:19 +03:00
Ngo Quoc Cuong 335a0eb4ad Remove log translations
The i18n team has decided not to translate the logs because it seems
like it not very useful; operators prefer to have them in English so
that they can search for those strings on the internet.

See http://lists.openstack.org/pipermail/openstack-dev/2017-March/thread.html#113365.

Change-Id: I4418a388934ef58acb70c7f637b0236a6ccc7fe6
Closes-Bug: #1682101
2017-05-11 13:43:05 +07:00
Jenkins ceaca8338f Merge "Replace six.iteritems() with .items()" 2017-04-20 15:52:26 +00:00
M V P Nitesh 1cde1a7fe8 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2.In py2, the performance about list should be negligible, see the
link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: Ib7ad61bac89e14561719434085b63cbad7e9a9be
2017-04-20 09:42:45 +00:00
Andrey Pavlov 6d30c69895 use glanceclient version '2'. fix keystone error message.
current devstack deploys glance version '2' only.
use it.

messages in keystone's exceptions was changed.
fix unit tests that checks it.

Change-Id: I7ed1f0ff518efa374a5e3b693c5785958c77340d
2017-04-19 13:10:40 +03:00
Jenkins 561a021d33 Merge "add instance in default-vpc by security-group-name or private-ip-address" 2017-02-27 08:38:10 +00:00
tikitavi df67b88930 add instance in default-vpc by security-group-name
or private-ip-address

add unit test

Change-Id: Iff5421ca84d5d5f6c2f87c9aed636ead6aadef2f
2017-02-09 23:07:57 +03:00
Jenkins 24d7ed706a Merge "Create new instance by default in default vpc" 2017-02-08 08:50:20 +00:00
tikitavi ead353712e Create new instance by default in default vpc
add unit test
Change-Id: I5a1b38312010ea92a2944ba3aa5d900cbc688751
2017-02-03 20:11:33 +03:00
Feodor Tersin 239464ab74 Honor Nova's restriction for bdm fields
Nova does not allow None values for bdm fields. However it stores them
in image metadata for volume bdm during snapshot operation of volume
backed instance. Ec2Api sends them back to Nova during run instance
operation, which violates Nova's restriction.

Here we cut out None values from image bdms before use it.

Change-Id: Ice913c935e288f1cb615443324c05ca3c31efca6
2016-12-29 12:24:44 +03:00
Andrey Pavlov 2cc7ec92dc fix races
1) fix bug with filtering
filters were applied before unpaired items is added to result

2) fix races in default security group creation

3) add waiter for associate/disassociate address

4) fix security group classic test
it should choose default group group only from classic groups

5) fix describe_vpc_with_filters test
it can run in parallel with other test with same CIDR

6) fix networks list for instance run at subnet creation/deletion

7) fix selective decsribe by names
it should not delete valid items from db

Change-Id: Iadadefb8b4abebbb3b8efc0e536e5de30ed23dab
2015-12-15 09:22:50 +03:00
Andrey Pavlov da6f97f291 rework certs stuff
remove ca_certs using for incoming requests
do small refactoring for keystone client using

Change-Id: I83dbb71248835cfc361eca691647deaa99023c8a
2015-11-12 11:19:06 +03:00
Andrey Pavlov 72fba9be44 py34: use ascii decoding instead utf-8 when it possible
Change-Id: I0daf7c0f89e1f5cd1e13edb4db2555d59a350383
2015-09-14 22:53:55 +03:00
Andrey Pavlov f34d64747c py34: fix string conversion
fix working with strings for metadata server,
for some instance properties and for errors.
do some magic with types/encoding.

Change-Id: I2446fc48b51dd903a719aa4dbb1a5556af19e5df
2015-09-13 23:56:53 +03:00
Andrey Pavlov 024b256eb8 py34: use range always instead xrange
because we have too little numbers in xrange to use six.moves

Change-Id: Icb31cb7056e0c30b744b83e7c5b914fa874d8f9b
2015-09-11 13:03:47 +03:00
Andrey Pavlov f51ca94079 py34: fix iteritems/itervalues using
Change-Id: Id3e3e814448be22184270db57ff43f5f83c4d1c1
2015-09-09 17:16:09 +03:00
Andrey Pavlov b64b3b09d4 py34: fix importing address module
it can't be imported due to gloval variable uses
iterkeys/iteritems of dictionary in instance module

Change-Id: I739d8d73c4a9bed0ad866bd667955fa3ce92fc8b
2015-09-09 17:00:34 +03:00
Feodor Tersin fe594a3a9e Clear conversion of source id to uuid in _build_block_device_mapping
This conversion affects only non blank source type bdms. Because that
it's better to use that fact explicitly.

Also improve comments in the function.

Change-Id: I64337d441f3289e36b7861d57d4a94eea8aa1447
2015-08-25 06:42:44 +03:00
Feodor Tersin 43378fa55a Substitute bdms specified with the same name
If a user specifies several bdms with the same name, the last specified
bdm should only be considered. This affects all API's methods having bdm
list in parameters.

Change-Id: I31f466065dbacbd53b70ba9865bce3005d8b1f0a
2015-08-24 21:44:05 +03:00
Andrey Pavlov 2e10e834fb add more waiting to instance type change
Amazon changes instance type immediately and returns when instance
in 'stooped' state. But our code can return when instance in
'resized' state and then can't start it. So this patchset adds some
waiting after confirm_resize to ensure that instance in right state.

Change-Id: I6ddeace63a3c448281ec17d1788c1eb22c594116
2015-08-18 09:43:15 +03:00
Feodor Tersin ffc445c964 Merge bdms of run instances parameters with image mappings
Implement AWS feature which allows a user to adjust bdm specified in an
image. The feature is used with boot operation by specifying changed
device attributes with the device name.

Change-Id: Ifb9c215527cd84a60f21ab73fee672928b604300
2015-07-20 17:53:38 +00:00
Feodor Tersin 89b364ce97 Make _parse_block_device_mapping to return only passed attributes
Currently this function set default values for certain bdm attributes,
such as delete_on_termination, or boot_index. Also it returns mappings
wich is not fully bdm v2 compatible. This prevents to use it for wide
range of purposes.

This patch make the function to return fully bdm v2 compatible mapping
with only passed (and unambiguously calculated) attributes are set.

Change-Id: I4a5ec244cc1d41855128090127a3b0fa266891c0
2015-07-20 17:57:45 +03:00
Feodor Tersin 516d4a1ce5 Move strip/prepend dev functions to ec2utils
These functions are useful for various ec2api modules but do not have
any instance specificity.

Change-Id: Ib4539986ce3019d47d56817ec5b1bcf056074d72
2015-07-16 11:38:49 +03:00
Feodor Tersin 0813aa6bdd Fix the optimization of single instance describing
Change-Id: I66bfe3b601d1cd3bb5be2cb9e615f66726e4a053
2015-07-03 02:41:26 +00:00
Andrey Pavlov c8dc89b9d2 switch instance and image api to bdm v2
Change-Id: Iccdc72352c47305f7fc6ec3c2793a12383bea549
2015-06-30 23:44:56 +03:00
Feodor Tersin d4e13b95ea Fix reservation group set for metadata API.
Also fix pep8 E123, E128, W503.

Change-Id: I180f1474cf8353c905c2bdc5172c70bc0dd5dd39
2015-06-19 12:50:49 +03:00
Feodor Tersin b19ce0116e Fix compatibility with legacy Nova client for metadata server
No test is changed because the project doesn't have tests for backward
compatibility.

Change-Id: I9f97b13d19415943f613ccc1f20e933fb5df410d
2015-06-19 11:04:38 +03:00
Andrey Pavlov dca51f09a0 implement instance resizing
support modifying of instance type attribute

Change-Id: Ieb760ce9bd9f8704501a039ca0ff1dee22b0179b
2015-06-02 19:43:04 +03:00
Feodor Tersin 711f7ec174 Remove underscore to camelCase conversion for XML output
Since we use camelCase in operation result formatting, this conversion
is unecessary.

Change-Id: I548c0be14c83be85eb06b84ae6f224b2b3477bf7
2015-05-27 15:45:24 +03:00
Andrey Pavlov 5cbcec6335 add source_dest_check to instance attributes
Change-Id: I6d10c35bb7d1eab383ba69fe5259485b5ef1b3bd
2015-05-25 12:59:25 +03:00
Andrey Pavlov 2f5a484b3a implement groupId for EC2 classic groups
Change-Id: Ia184f1482d1e4a01fc676613abdccfa3c1a72d09
2015-05-22 19:54:42 +03:00
Andrey Pavlov 49822ce31b implement groupSet attribute for instance attributes
Change-Id: Ie92547208570221e735ba4c90dec97071da2b204
2015-05-14 13:05:10 +03:00
Andrey Pavlov 95c8930bfb implement modify/reset instance attribute. part 1.
implement only one attribute - disableApiTermination.

Change-Id: Ida88bcb047bcadd6cfe18c76f3af4777a431dad2
2015-05-12 14:08:34 +03:00
Andrey Pavlov c0796154fd implement paging
Change-Id: Id044e0943ed163cf33631b035c3e09f7ace4f668
2015-04-28 11:33:19 +03:00
Jenkins 60cf5a5184 Merge "Remove and actualize some TODOes" 2015-04-23 10:23:12 +00:00
Feodor Tersin feaa88d7ff Remove and actualize some TODOes
1 type of min and max count is now checked by validator, therefore the
check in certain api level isn't needed
2 actualize TODO about security group
3 fix style

Change-Id: I8cae95a44c7fc2e6e4b9fbc183806f09b9e9df0f
2015-04-23 11:03:44 +03:00
Feodor Tersin d8409de68a Fix GetConsoleOutput and GetPasswordData
1 Add optional receiving instance_id as a list of id with single id
2 Encode console output and password data

There is one more Depends-On which we can't wait for so it's purely 
informational: Depends-On: I36ef88a561e60fb5dc3e687cb8bc02b27ec2e814

Depends-On: I711314408ec7c4ea75f93348a7335843713e9a2b

Change-Id: I0d62238bbf3a549344d578e131e8be9b3f268cf1
2015-04-22 10:42:33 +00:00
Andrey Pavlov a98a506eb9 add test for bug #1215527
also fake result for 'disableApiTermination' added
in DescribeInstanceAttribute. One of next reviews will add this
functionality.

fix botocore version to 0.103
version 0.104 returns some inconsistent information

Change-Id: I581e803a57c9ee63e873308c0f08cd7cf2158230
2015-04-17 15:31:51 +03:00
Jenkins d2fba17607 Merge "Optimized describing of instance." 2015-04-14 15:15:04 +00:00
Alexandre Levine 8a0963aa71 Optimized describing of instance.
Change-Id: I4685621ce72ef4004fc05b2628493b8c5b8f0fd5
2015-04-14 18:24:25 +04:00
Andrey Pavlov 64fc208ecf restrict listing neutrons' resources to one tenant for admin
Change-Id: I587f208f9166b3b560331129d81c2a192891c3be
2015-04-14 16:47:23 +03:00
Alexandre Levine ae298a3a26 Added default flavor. Made flavors to be retrieved once in describe.
Change-Id: I17379179b433b1ea77b19676f54a122304695621
2015-04-13 20:38:56 +04:00
Alexandre Levine 91ad95ce4b Added state for instance disappeared after deletion.
Changed mapping of DELETED->TERMINATED VM state to
DELETED->SHUTTING DOWN. It allows clients to wait until instance
completely disappears, while now they might take action when
some of it's parts still do exist.
It was found as a race during instance termination.

Change-Id: Idb146ef4acdb3cca005b252277f89b72ba9da304
2015-04-10 18:17:28 +04:00
Andrey Pavlov 97e72e40d0 Performance: leverage dict comprehension in PEP-0274
merged from Ifb5cb05b9cc2b8758d5a8e34f7792470a73d7c40

PEP-0274 introduced dict comprehensions to replace dict constructor
with a sequence of length-2 sequences, these are benefits copied
from [1]:
  The dictionary constructor approach has two distinct disadvantages
  from the proposed syntax though.  First, it isn't as legible as a
  dict comprehension.  Second, it forces the programmer to create an
  in-core list object first, which could be expensive.
Nova dropped python 2.6 support, we can leverage this now.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].
Note: This commit doesn't handle dict constructor with kwagrs.
This commit also adds a hacking rule.

[1]http://legacy.python.org/dev/peps/pep-0274/
[2]http://doughellmann.com/2012/11/12/the-performance-impact-of-using-dict-instead-of-in-cpython-2-7-2.html
[3]http://paste.openstack.org/show/154798/

Change-Id: I1bc53e335b6c291da5c54f067f9fdfd5da6b2902
2015-04-02 16:07:58 +03:00
Andrey Pavlov 1cdaf9fe00 add absent filters
Change-Id: I3e5de1b5bd3a0fe238d78c32b627609e1ef886ae
2015-04-02 12:27:45 +03:00