To ensure project imports are placed after third party import,
we need to specify application-import-names.
Previously flake8-import-check checks only standard imports or not.
Change-Id: I9beb2105f686dc7d9aebfce8e21c5e182698e2fe
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.
After this, there are only 3 noqa under openstack_dashboard/ :)
Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
The semantic_version.Version objects don't properly support hashing,
so we need to handle that in our wrapper, so that the "in" operator
can work properly with sets and dicts.
Closes-Bug: #1649819
Change-Id: I85e2b2214546817ef4da136b7d4267985ced94dc
Since the APIVersionManager stored the version numbers as ints and
floats, it was not possible to distinguish between version 1.2 and 1.20,
and also version 1.2 would be considered higher than version 1.13. With
the introduction of microversioning in some services, the version
numbers inflate quickly, making this a problem.
This patch wraps the version numbers in a Version object, that stores
the information as a semantic_version and correctly compares with other
Version objects, as well as ints, floats and strings.
It also removes the check for version being specified as a string, so
that it's possible to specify versions such as 1.20 without having to
explicitly create Version objects.
Change-Id: I0b0d87582d617290f08359ad181216cb99edb768
Closes-Bug: #1649819
Previously api.neutron.Network object was compared by using _apidict
but it did not work when for example the order of subnet list is different.
This commit changes the comparison logic to use network ID explicitly.
In addition, it moves the logic to fetch external networks to api.neutron.
Change-Id: Ie3a42e29c32c17a7f3bf1596b0e09cb73eae9d2a
Closes-Bug: #1528465
Only shared networks were considered as external.
The Neutron policy since Icehouse is router:external=True and shared=False so
external networks were not seen anymore
We need to be able to see the external network to obtain its ID (e.g. for
heat templates in the orchestration panel).
We now display external networks and added an "external" field in the networks
view
Change-Id: Ice1f4e2c11825b8d86a8a126350e71a88741acb7
Closes-Bug: #1472281
Remove service_name argument from the is_service_enabled function.
The argument is unused and complicates the function's logic.
Change-Id: I1ac8a037bd7908ef1101d5fec359a8fe0e16e24a
Don't assume that the service catalog is well-formed, added code
to safely parsing the catalog.
Parsing of region from service catalog has been fixed as well.
'region' has been deprecated in the Keystone V3 catalog in favor of
'region_id'. Fix how region is extracted by checking 'region_id' then
fallback to 'region'.
Change-Id: I9e027586847b7b7c0276e8c3ff6b73f06a32e2a5
Closes-Bug: #1424825
In this update:
- fixed tests
- fixed exception handling, params on ports
- fixed to_dict for a number of cases
- replaced use of request.DATA with request.GET for GET methods
- added handling of HTTP error raised with no status/code attr
- removed check for network_id in subnets as it's not required
- fix to_dict for Network with Subnets
Supercedes
https://review.openstack.org/#/c/152243https://review.openstack.org/#/c/151313
Partially Implements: blueprint launch-instance-redesign
Co-Authored-By: Aaron Sahlin <asahlin@us.ibm.com>
Co-Authored-By: Michael Hagedorn <mike.hagedorn@hp.com>
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Change-Id: Ia40fde6d66720a03a531b516a6a53a2e86ec0d8f
This provide flavor APIs for launch instance work.
This provides extension APIs for launch instance work.
This provides single server get for instance details work.
This provide single flavor get for instance details work.
Partially Implements: blueprint launch-instance-redesign
Partially Implements: blueprint instance-details-redesign
Change-Id: Ia1fd36ec31de21c60801f4d47716ef69aad7525f
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
* Verifies that the API version values provided are of the right type
(currently all version keys are ints or floats, not strings).
* Provides a list of the version keys which would be acceptable if an
invalid version is provided.
* Raises a useful and explanatory exception if these values are
incorrect.
* Adds the "preferred" API version to the "supported" versions as
a convenience during init.
Change-Id: I0bc75b145bba757ff6cd405e1a654aeef296f2df
Closes-Bug: 1411427
when the cinder services exist but endpoint deleted, accessing
to /project/access_and_security will cause an error:
IndexError: list index out of range
Change-Id: Iad7f72cd5247f33245f25a8092c40a4d3a04cef9
Partial-Bug: #1394900
this change will attempt to use a identity service in the selected region
when available. before the region for the identity service was always the first
found
Change-Id: Idc64a32128bcee561cdbba956722adad0ee1eaf2
Closes-Bug: #1339382
The APIDictWrapper class within openstack-dashboards/api/base.py can't
handle the "in" operator correctly.
Also, it will fail if a non-string is passed into it's __getitem__
method. (Which is what is called from a dict lookup.)
The get method also fails on non-strings.
Change-Id: Iaad66d3c6deb81d0570b1a8c6ddf580024fa46e6
Closes-Bug: 1326512
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4
at the top of source code files, except for files in
openstack/common.
Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
Instead of (implicitly) catching the AttributeError, and later
creating and raising a new one, we just re-raise the original
exception. This way all the information from the original is
retained, including the name of the actual object on which it
happened.
Change-Id: Idc0c5a8ed5dfca6a8724e393c220baf9960564ed
Closes-bug: #1274097
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
In an effort to help horizon more friendly to OpenStack hacking
guidelines, we now gate on H40* violations.
Change-Id: Id07294543660368d2f7f5ac363710176ab23b874
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
If region is passed in to url_for use that, otherwise continue
to use the region from the user's session.
Fixes bug #1231171
Change-Id: Ia7d2a4f12a3c0d4d45bb918255184d1736f5bddf
Also ensure that the correct quota is displayed in the Floating IPs
allocation page (Security & Access panel).
Closes-Bug: #1109140
Change-Id: I30d207fbf149bfbcfefeaddf91af49082b7b1f53
Display the correct limits and usage when Neutron is in use and the
quotas extension is enabled. If Neutron is enabled but the quotas
extensions is not supported, assume the floating IPs quota is
unlimited (a floating IP quota is expected to exist in other places,
e.g. Security and Access panel)
Because quotas may not be configured or enabled even if the extension
is available, add an 'enable_quotas' setting.
Partial-Bug: #1109140
Change-Id: Id6345f4700f0ff45be8ce8acb69cca0d4e05e14a
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
Fixes bug 1202415
__repr__ was added to APIResourceWrapper in the recent commit,
but it searches all attributes in _attrs list. When an attribute
defined in _attrs actually does not exist, __repr__() fails.
This commit changes __repr__ to ignore non-existing attributes.
Change-Id: Iebaeae78f3763d87f3993ba5c4bbed4c23e84c45
blueprint quantum-security-group
Rule table view
* Add direction and ethertype columns (which are specific to Neutron)
It may be better to hide "Direction" and "Ether Type" columns
unless Quantum security group is enabled.
* Merge ip_protocol/from_port/to_port into one column for better view
* Use "::/0" for IPv6 ANY instead of "0.0.0.0/0"
* Rename "Source" column to "Remote".
(The naming "source" does not fit egress rules)
* Display security group name in the title of rule detail view
Rule creation form
* New arguments 'direction' and 'ethertype' in security_group_rule_create()
* Set the default value of 'direction' to 'ingress' in forms.handle()
* Rename 'ip_protocol' to 'rule_menu' and 'source' to 'remote'
Note that rule_menu is retrieved from rule.ip_protocol in the unit tests
since they are tests for custom TCP/UDP/ICMP rules.
Network abstraction layer for security group management
* Move security group methods to api.network
* Add Neutron security group API implementation
* Move base classes for network abstraction to a separate module
(api/network_base.py) to avoid circulated import between
api.network and api.nova/api.neutron
Add a configuration parameter to control Neutron security group support
* Neutron security group support is enabled when Neutron is enabled and
enable_security_group in OPENSTACK_NEUTRON_NETWORK in settings is True.
* Not all neutron plugins support security group, so we need a way
to control neutron security group is enabled or not.
* It can be determined by supported extension list from Neutron
and it is a possible future work.
Move get_int_or_uuid to openstack_dashboard/utils/filters.
* get_int_or_uuid is now used in security_group implementation as
well as floating IP logics.
* In addition the depth of the directory tree becomes longer and
it is hard to fit the import line in 80 chars.
It is a good chance to move it to a common directory.
Add __repr__ to API**Wrapper to make it easier to debug.
Limitations:
Neutron supports per-port security group. security groups can be
associated with a port instead of an instace and each port can have
a different set of security groups. It is not a scope of this BP
and is a future work.
Change-Id: I5410e88043a364596037b9ebcc566cd50b317614
This patch adds a region selector dropdown
at the top of both the Project and Admin dashboards if
more than one region is available in the user's service
catalog. The user is allowed to choose from any region
available in the service catalog. By selecting a region,
the user is limited to accessing endpoints in that
region only as long as the go through api.base.url_for
If there are more than one endpoint for a service in a
region the first in the catalog is returned. Further
work on the blueprint will handle that complexity.
Supporting Keystone v2.0 and v3 catalog formats.
Partially implements blueprint multiple-service-endpoints
Change-Id: I1ab6539c7c5f4b1ae4b1716059370e86b6ca4d2e
Python 3.x removed the "except x,y:" construct. Use
"except x as y:" instead which works with all
Python versions >= 2.6.
Change-Id: Iedb4c5a6d8580cbb6c9697933d006e94b1db916d
Removed unused admin parameter that was unused and removed tests
that were no longer necessary.
Added an option configuration setting SECONDARY_ENDPOINT_TYPE that
will be attempted if the OPENSTACK_ENDPOINT_TYPE does not exist
in the service catalog for the desired service.
The primary use case for this fix is in cloud configurations
where Keystone does not return all endpoint types for each
service, and only does so based on the user's privilege level.
Example use case would be set OPENSTACK_ENDPOINT_TYPE to 'adminURL'
and set SECONDARY_ENDPOINT_TYPE to 'publicURL'. If adminURL is not
available to the user, then they get the publicURL back.
If SECONDARY_ENDPOINT_TYPE is not set in the settings, then the
current behavior is maintained.
Fixes: bug #1186379
Change-Id: Ieefb6ed5dd88e5c840ef6bad93ae87237a1b63f9
Instead of relying on the configuration file for determining how
the catalog should be parsed, make it flexible by inspecting the
structure of the service catalog passed to it.
Fixes bug 1180486
Change-Id: I0c8caf4c8365bf25377ab3a249ac280d8add0f17
In Keystone V3, the service catalog in the token response
has been split into multiple entries per service. This change
checks the version of the Identity Service and performs the
appropriate parsing of the catalog.
Core code for Keystone V3 authentication are in openstack_auth.
TODO: Move to auto-detection of API versions when it is available.
Implements blueprint login-domain-support
Change-Id: I69073e5744def037caf522b1123755668887cfd9
Introduces a mechanism for switching between API versions,
and implements it in a proof-of-concept fashion for the
Keystone v3 API. Converts the existing Users and Projects
API methods to use it.
This changed some method signatures, and therefore altered
a number of views and tests. However, all code related to
the version cahnges is contained in the api.keystone module.
This seems like a sane process going forwards.
Future TODOs are marked in the code, including auto-detection
of API versions and better endpoint URL construction.
Partially implements blueprint api-capability-detection
Change-Id: Ied04200fe6c257aac2241d36628965a3bb6658b9
Now that there are multiple projects with quota data (cinder, quantum)
we need to accommodate that data being aggregated in a centralized
fashion. This commit takes care of that for nova + cinder, and paves
the way for quantum later.
Fixes bug 1070022.
Change-Id: Ifc68c2dc681b2a7b4e7787e0b1a7dca1a970fc36
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.
Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b