Remove munch dependency

This is not maintained and is no longer used by openstacksdk. There are
only three users of the library, one of which is incorrect and the
remainder of which we can easily replace.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Iae5b09dc163e8a4e0ed51f065079301b7e4287d3
(cherry picked from commit 6e306cc550)
(cherry picked from commit 50ef00a817)
(cherry picked from commit 06d2810fdd)
This commit is contained in:
Stephen Finucane 2023-02-21 10:35:59 +00:00 committed by Gregory Thiemonge
parent 125cfe3077
commit a2a4646157
3 changed files with 14 additions and 9 deletions

View File

@ -10,9 +10,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import munch
from openstackclient.identity import common as identity_common
from osc_lib import exceptions as osc_exc
from osc_lib import utils
@ -677,9 +675,13 @@ def get_unsets(parsed_args):
return unsets
class _Munch(dict):
__getattr__ = dict.get
def wait_for_active(status_f, res_id):
success = utils.wait_for_status(
status_f=lambda x: munch.Munch(status_f(x)),
status_f=lambda x: _Munch(status_f(x)),
res_id=res_id,
status_field=constants.PROVISIONING_STATUS,
sleep_time=3
@ -695,7 +697,7 @@ def wait_for_delete(status_f, res_id,
class Getter(object):
@staticmethod
def get(id):
return munch.Munch(status_f(id))
return _Munch(status_f(id))
try:
success = utils.wait_for_delete(

View File

@ -9,12 +9,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import argparse
import copy
import itertools
from unittest import mock
import munch
from osc_lib import exceptions
from oslo_utils import uuidutils
@ -463,9 +463,12 @@ class TestLoadBalancerCreate(TestLoadBalancer):
# subtract comb's keys from attrs_list
filtered_attrs = {k: v for k, v in attrs_list.items() if (
k not in comb)}
# Add the 'wait' attribute, which isn't part of an LB directly
filtered_attrs['wait'] = False
mock_client.return_value = filtered_attrs
parsed_args = argparse.Namespace(**filtered_attrs)
if not any(k in filtered_attrs for k in args) or all(
k in filtered_attrs for k in ("vip_network_id",
"vip_port_id")
@ -473,10 +476,11 @@ class TestLoadBalancerCreate(TestLoadBalancer):
self.assertRaises(
exceptions.CommandError,
self.cmd.take_action,
filtered_attrs)
parsed_args
)
else:
try:
self.cmd.take_action(munch.Munch(filtered_attrs))
self.cmd.take_action(parsed_args)
except exceptions.CommandError as e:
self.fail("%s raised unexpectedly" % e)

View File

@ -11,4 +11,3 @@ oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
pbr!=2.1.0,>=2.0.0 # Apache-2.0
requests>=2.14.2 # Apache-2.0
munch>=2.1.0 # MIT