In reviews we usually check import grouping but it is boring.
By using flake8-import-order plugin, we can avoid this.
This flake8 plugin is already used in tempest.
It enforces loose checking so it sounds good to use.
Note that flake8-import-order version is pinned to avoid unexpected
breakage of pep8 job.
Change-Id: I8ccd05eb70350a2441cc2a4d1eafc09ee690b83b
Added server-side filtering for containers in swift UI using the
magic search directive.
Change-Id: Id0eaa818fab8b2c7d7a0ab40c1a943c2e7342f10
Partial-Implements: blueprint server-side-filtering
Since Horizon is going to be the first (or, one of the first)
OpenStack component using the new MongoDB driver, it won't be able to
retrieve traces made by other components using MongoDB driver (which
it should use because Ceilometer driver was too slow) for a
while. This means that Horizon itself is responsible for tracing the
rendering of its pages down to the layer where the flow of control
leaves Horizon domain. So, a lot of api wrappers in
openstack_dashboard.api are augmented with tracing decorator to
achieve this goal.
Co-Authored-By: Timur Sufiev <tsufiev@mirantis.com>
Implements-blueprint: openstack-profiler-at-developer-dashboard
Change-Id: Ib36692f0e9e68ed7fa0cd47919ba6581c9c8ab57
The containers module was using an incorrect ID in the "Size" column,
preventing the user from sorting by "Size". This change updates the
ID s/size/bytes/ which is the resource property holding the actual object size
in Bytes.
This change also updates the default "subdir" size to 0, that is the
default value returned in the "Content-Length" header for "subdirectories"
Change-Id: I98d164ec1a08d15f25fcdbc92f45e46c9fa6e5c4
Closes-bug: 1643710
The ability to update (edit contents of) an object was
never present in the previous Swift UI. It was
explicitly blocked due to code in the swift_upload_object()
function, which has been removed in this patch. To
replace that "upload would replace existing contents"
check, this patch implements a client-side check to warn
the user if the upload would do so.
Partially-Implements: blueprint swift-ui-functionality
Change-Id: I9fb57dda59322907f0661372f9ee223551ff8a6e
This memoize usage holds on to connection objects for a very long
time, resulting in exhaustion of file descriptors.
Change-Id: If7367819b050a65562b3e05175ab15bd93d0d398
Fixes-Bug: 1584109
Swift doesn't really have folders, it just has object listings
matching string prefixes. This will get confused if two objects
have the same string prefix name, so just don't do it.
Change-Id: Iab818cc965aab1470aa41ebebd5db7c50ed3836d
Fixes-Bug: 1583391
First, tolerate missing '/info' API endpoint, which Ceph doesn't
support yet. Second, `content_type` attribute on objects may be not
set, don't rely heavily on it.
Change-Id: I101338aa9c96a6551bfbf2dd9c460a4801b4e7b6
Closes-Bug: #1564834
Adding the REST API needed to support the new angular Swift UI.
Co-Author: Neill Cox <neill@ingenious.com.au>
Change-Id: Ife1073cf6aa481bdbd89f09805ac76fe7106d5df
Partially-Implements: blueprint angularize-swift
Show error message instead of success message when attempting to
create a duplicate object or pseudo-folder. Added tests for
creating and creating duplicate pseudo-folders.
Change-Id: I875d471921d9a37bb6706a17d4fbca5e9428ae93
Closes-Bug: #1478126
This patch adds missing content-length header
param into swift_upload_object() method.
Without it object upload handling could be failed
with "411 Length Required" error if Ceph is used
as an object storage.
Change-Id: Id0813806abb36a6f015efd13ec987492a3701476
Closes-Bug: #1352256
The variable _safe_message is linked to logic that is either no
longer used or not implemented. Removing the variable is a part
of improving the exception message by using 1 source to generate
the exception message
Partially Implements: blueprint improve-error-message-details-for-usability
Change-Id: Ied1acf22790cdedad685990fc628462d51b1477e
To prevent memory overrun when downloading large objects from Swift
* `resp_chunk_size` keyword should be passed to swiftclient
* `obj.data` iterator returned from swiftclient is passed to HttpResponse
(or StreamingHttpResponse for Django>=1.5) as usual since both response
classes work with iterators/files/byte strings (yet StreamingHttpResponse
does it better).
The commit introduces new setting SWIFT_FILE_TRANSFER_CHUNK_SIZE that
defines the size of chunk in bytes for Swift objects downloading.
DocImpact
Change-Id: I18e5809b86bfa24948dc642da2a55dffaa1a4ce1
Closes-Bug: #1427819
oslo_utils moved out of the oslo namespace.
Partially Implements: blueprint drop-namespace-packages
Change-Id: I3c38426142de535b5474676b1214ea72b231ce76
while try to delete a pseudo folder which contains some objects is
showing the success message but the folder is not actually deleted
added a check similar to delete container, the new check will
verify the pseudo folder is empty before call the swift client
call. if the folder is not empty it will throw a exception
with a appropriate error message and the message will be shown to
the user in the pop up message box.
Change-Id: I0bbea6ef6ac26ef357240610535b9d84053a89c2
Closes-Bug: #1347598
Previously token values are logged as DEBUG level when a new client
object is instantiated. In other project and clients, token values
are now not logged and is output as *REDACTED* instead.
In Horizon these log lines do not have much meaning and
we can simply remove them.
Change-Id: I67617ac6424907574d79ec2a57b513a548e220d2
Closes-Bug: #1380642
E127 continuation line over-indented for visual indent
Also fixes E127 introduces by other reviews
after other E127 fixes were merged.
Closes-Bug: #1375931
Change-Id: I0a09f1c2f74c707fc8a347f0ea5975bf2679976e
Rather than sync'ing with oslo-incubator, let's use the library
oslo.utils instead. Removing the local copy of timeutils.
Change-Id: I4fbc7e7637577fcad8281897f4286690b1bbd14d
Partially-Implements: blueprint improve-oslo-usage
When using urlparse.quote, the string needs to be utf8 encoded,
or an exception is thrown.
Change-Id: I1e3d4abc136fbbbd03a54789f3df0855ceea98e1
Closes-Bug: 1346386
Co-Authored-By: Cédric Soulas <cedric.soulas@cloudwatt.com>
Previously API client object like novaclient are created
every time methods in openstack_dashboard/api.
It leads to regeneration of API HTTP connections.
This commit caches API client object for a WSGI request
to reduce the number of HTTP connection to backends.
As WSGI request object is recreated, a cached API client
object will live in a single request to Horizon.
Change-Id: I66620b3b0a2737c7232d91006e65d0fabbd3090b
Closes-Bug: #1352144
The swift API client connection does not respect the
OPENSTACK_SSL_NO_VERIFY setting in the local_settings.py.
As a result a SSL verfication error happens with a
self-signed certificate.
Closes-Bug: #1311357.
Change-Id: I907a8f7c5c631adfaf2ca66385749bb8e86734f2
Signed-off-by: Chuck Short <chuck.short@canonical.com>
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
Now the user can create an Object without providing an actual file
in the containers view. This will submit an object with 0 bytes size.
Additionally, the 'Download' button will not be available for objects
with 0 bytes size.
Implements: blueprint metadata-only-object
Change-Id: Ib2ff2462b73d16c971ad0dfc60aaae1b0bbf0924
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
Allow the user to set the container access to private or public.
For public containers, the public URL for accessing it is also provided
to the user.
List containers does not include the metadata of the container. Used ajax
to load the container metadata in the Container table to be able to render
the Container table immediately.
Change-Id: If1e848ad49f522eab8f1b264d54611615481848c
Implements: blueprint swift-container-public-access
When user tries to delete non-empty container, the success messsage
should not be displayed.
Change-Id: I02ba1e4bad8dbe2b52f06f2a8e079b5812cd5544
Closes-bug: 1214842
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>
GET operation downloads the whole object, replaced the call
with HEAD which already contains the object metadata.
Change-Id: I87e1145d9571013db3dd87c3386d0dd66da3f012
Closes-bug: 1236681
The various OpenStack client libaries support specifying a SSL
certificate that should be used to verify the SSL-connection, but
this option was not exposed in the horizon options. This patch
implements that. Note that although some clients do implement a
cacert-parameter, they do not necessarily actually verify the
certificate (Swift).
Change-Id: I9dfbd48a0d96103421da7d884e839d591a90cab1
Implements: blueprint ssl-cacert
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
We cannot delete objects in the container since there may be millions
of objects in that. The batch deletion should be done in swift instead
of Horizon. The batch remove of objects function is only in swift CLI
command now. This commit replace the unclear message with a warning
message that tells the user the container is not empy.
Related bug: https://bugs.launchpad.net/horizon/+bug/1034890
Fixes bug: #1096084
Change-Id: I59b46a3535b8654734c3dae4eec916ab1b53c716
A subfolder in a container is now represented solely by the prefix of
an object name delimited by a forward-slash (/). If an object exists
in a container that matches the implied subfolder of another object,
each will be displayed in the objects table.
Implements bp swift-folder-prefix
Change-Id: I05252c1db34fdf6584a71e8827ff6f8363bf0488
Removed deprecated check for unicode symbols
in object names, fixed the reverse() for success_url,
which expects "/" to be included in path arguments.
Fixes bug 1008940
Change-Id: I1122437c40f8e31b64a82b39cd326141842ca519
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