Remove bit_length_power_of_2
This change is to remove bit_length_power_of_2 from this repo since it has been moved to openstack-ansible-openstack_hosts. This is because it is only used by that repo. Depends-On: I543328db49dc6b7bbb05878503dbb3d337a18558 Change-Id: I9e2b3e10ec42d246d203e363f0c737b8824ccd47 Closes-bug: #1826242
This commit is contained in:
parent
5af0b9bcc3
commit
fc9e016e90
|
@ -2,16 +2,6 @@
|
|||
Filters
|
||||
=======
|
||||
|
||||
bit_length_power_of_2
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
This filter will return the smallest power of 2 greater than a given numeric
|
||||
value.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
{{ 1000 | bit_length_power_of_2 }}
|
||||
# => 1024
|
||||
|
||||
deprecated
|
||||
~~~~~~~~~~
|
||||
This filter will return the old_var value, if defined, along with a
|
||||
|
|
|
@ -143,15 +143,6 @@ def _lower_set_lists(list_one, list_two):
|
|||
return _list_one, _list_two
|
||||
|
||||
|
||||
def bit_length_power_of_2(value):
|
||||
"""Return the smallest power of 2 greater than a numeric value.
|
||||
|
||||
:param value: Number to find the smallest power of 2
|
||||
:type value: ``int``
|
||||
:returns: ``int``
|
||||
"""
|
||||
return 2**(int(value)-1).bit_length()
|
||||
|
||||
def string_2_int(string):
|
||||
"""Return the an integer from a string.
|
||||
|
||||
|
@ -268,7 +259,6 @@ class FilterModule(object):
|
|||
@staticmethod
|
||||
def filters():
|
||||
return {
|
||||
'bit_length_power_of_2': bit_length_power_of_2,
|
||||
'string_2_int': string_2_int,
|
||||
'pip_requirement_names': pip_requirement_names,
|
||||
'pip_constraint_update': pip_constraint_update,
|
||||
|
|
|
@ -20,12 +20,6 @@
|
|||
connection: local
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Validate bit_length_power_of_2 filter
|
||||
assert:
|
||||
that:
|
||||
- "{{ 1024 | bit_length_power_of_2 }} == 1024"
|
||||
- "{{ 9600 | bit_length_power_of_2 }} == 16384"
|
||||
|
||||
- name: Validate string_2_int filter
|
||||
assert:
|
||||
that:
|
||||
|
|
Loading…
Reference in New Issue