Merge "Removing unused filters from osa plugins"
This commit is contained in:
commit
fa93ca1b24
|
@ -88,21 +88,6 @@ list of pip package constraints to a apply to that list.
|
|||
{{ pip_package_list | pip_constraint_update(pip_package_constraint_list) }}
|
||||
# => [ "babel==2.3.4", "pip==8.1.0", "setuptools==25.1.0", "wheel==0.29.0" ]
|
||||
|
||||
pip_requirement_names
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
This filter will return of list of package names from a given list of pip
|
||||
packages.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
pip_package_list:
|
||||
- pip==8.1.2
|
||||
- setuptools==25.1.0
|
||||
- wheel==0.29.0
|
||||
|
||||
{{ pip_package_list | pip_requirement_names }}
|
||||
# => [ "pip", "setuptools", "wheel" ]
|
||||
|
||||
splitlines
|
||||
~~~~~~~~~~
|
||||
This filter will return of list from a string with line breaks.
|
||||
|
|
|
@ -162,24 +162,6 @@ def string_2_int(string):
|
|||
return int(hashed_name, 36) % 10240
|
||||
|
||||
|
||||
def pip_requirement_names(requirements):
|
||||
"""Return a ``str`` of requirement name and list of versions.
|
||||
:param requirement: Name of a requirement that may have versions within
|
||||
it. This will use the constant,
|
||||
VERSION_DESCRIPTORS.
|
||||
:type requirement: ``str``
|
||||
:return: ``str``
|
||||
"""
|
||||
|
||||
named_requirements = list()
|
||||
for requirement in requirements:
|
||||
name = _pip_requirement_split(requirement)[0]
|
||||
if name and not name.startswith('#'):
|
||||
named_requirements.append(name.lower())
|
||||
|
||||
return sorted(set(named_requirements))
|
||||
|
||||
|
||||
def pip_constraint_update(list_one, list_two):
|
||||
|
||||
_list_one, _list_two = _lower_set_lists(list_one, list_two)
|
||||
|
@ -260,7 +242,6 @@ class FilterModule(object):
|
|||
def filters():
|
||||
return {
|
||||
'string_2_int': string_2_int,
|
||||
'pip_requirement_names': pip_requirement_names,
|
||||
'pip_constraint_update': pip_constraint_update,
|
||||
'splitlines': splitlines,
|
||||
'filtered_list': filtered_list,
|
||||
|
|
|
@ -31,10 +31,6 @@
|
|||
- pip==8.1.2
|
||||
- setuptools==25.1.0
|
||||
- wheel==0.29.0
|
||||
pip_package_list_1_names:
|
||||
- pip
|
||||
- setuptools
|
||||
- wheel
|
||||
pip_package_list_2:
|
||||
- babel==2.3.4
|
||||
- pip==8.1.0
|
||||
|
@ -45,12 +41,10 @@
|
|||
- wheel==0.29.0
|
||||
- name: Set pip package filter facts
|
||||
set_fact:
|
||||
pip_package_list_1_names_filtered: "{{ pip_package_list_1 | pip_requirement_names }}"
|
||||
pip_package_list_constraint_filtered: "{{ pip_package_list_1 | pip_constraint_update(pip_package_list_2) }}"
|
||||
- name: Validate pip requirement filters
|
||||
assert:
|
||||
that:
|
||||
- "pip_package_list_1_names_filtered == pip_package_list_1_names"
|
||||
- "pip_package_list_constraint_filtered == pip_package_list_merged"
|
||||
|
||||
- name: Set splitlines string facts
|
||||
|
|
Loading…
Reference in New Issue