Skip to content

Commit

Permalink
Filtering by configuration path and module for more objects (#3060)
Browse files Browse the repository at this point in the history
This patch adds ability to filter objects DataCenterAsset, DCHost,
VirtualServer or CloudHost types by their configuration_path.module
and configuration_path.path.
  • Loading branch information
romcheg authored and xliiv committed May 15, 2017
1 parent 4f52bcb commit 615d3c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ralph/data_center/admin.py
Expand Up @@ -343,7 +343,7 @@ class DataCenterAssetAdmin(
'status', 'barcode', 'sn', 'hostname', 'invoice_no', 'invoice_date',
'order_no', 'model__name',
('model__category', RelatedAutocompleteFieldListFilter), 'service_env',
'configuration_path',
'configuration_path__path',
('configuration_path__module', TreeRelatedAutocompleteFilterWithDescendants), # noqa
MacAddressFilter,
'depreciation_end_date', 'force_depreciation', 'remarks',
Expand Down Expand Up @@ -568,7 +568,8 @@ class DCHostAdmin(ScanStatusInChangeListMixin, RalphAdmin):
list_filter = [
DCHostHostnameFilter,
'service_env',
'configuration_path',
'configuration_path__path',
('configuration_path__module', TreeRelatedAutocompleteFilterWithDescendants), # noqa
('content_type', DCHostTypeListFilter),
MacAddressFilter,
IPFilter,
Expand Down
3 changes: 3 additions & 0 deletions src/ralph/virtual/admin.py
Expand Up @@ -98,6 +98,7 @@ class VirtualServerAdmin(
list_filter = [
BaseObjectHostnameFilter, 'sn', 'service_env', IPFilter,
'parent', TagsListFilter, MacAddressFilter,
'configuration_path__path',
('configuration_path__module', TreeRelatedAutocompleteFilterWithDescendants), # noqa
('securityscan__vulnerabilities__patch_deadline', VulnerabilitesByPatchDeadline), # noqa
(
Expand Down Expand Up @@ -222,6 +223,8 @@ class CloudHostAdmin(
list_filter = [
BaseObjectHostnameFilter, 'cloudprovider', 'service_env',
'cloudflavor', TagsListFilter,
'configuration_path__path',
('configuration_path__module', TreeRelatedAutocompleteFilterWithDescendants), # noqa
('securityscan__vulnerabilities__patch_deadline', VulnerabilitesByPatchDeadline), # noqa
(
'securityscan__vulnerabilities', RelatedAutocompleteFieldListFilter
Expand Down

0 comments on commit 615d3c8

Please sign in to comment.