diff options
author | Vladyslav Drok <vdrok@mirantis.com> | 2017-07-25 15:06:08 +0300 |
---|---|---|
committer | Vladyslav Drok <vdrok@mirantis.com> | 2017-07-31 10:14:08 +0000 |
commit | ea3f62a132d094ea7f71140e7dc22b5f4fb9964e (patch) | |
tree | c7c5f223f1abc099f42de9e654a7971b56f153a6 /ironic/tests/unit/dhcp | |
parent | 11e79b921457a9b239bf0d771716a089c0683b69 (diff) | |
download | ironic-ea3f62a132d094ea7f71140e7dc22b5f4fb9964e.tar.gz |
Remove usage of some of the deprecated methods
Switch to enginefacade.writer during migrations instead of using
legacy facade, use inspect.signature instead of inspect.getargspec
in python 3.
Change-Id: I8ce536a5ce7e9f248d75fb9de8e7c1974a3423b3
Diffstat (limited to 'ironic/tests/unit/dhcp')
-rw-r--r-- | ironic/tests/unit/dhcp/test_factory.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ironic/tests/unit/dhcp/test_factory.py b/ironic/tests/unit/dhcp/test_factory.py index b5c762848..13c434b50 100644 --- a/ironic/tests/unit/dhcp/test_factory.py +++ b/ironic/tests/unit/dhcp/test_factory.py @@ -16,6 +16,7 @@ import inspect import mock +import six import stevedore from ironic.common import dhcp_factory @@ -84,6 +85,8 @@ class TestDHCPFactory(base.TestCase): class CompareBasetoModules(base.TestCase): def test_drivers_match_dhcp_base(self): + signature_method = inspect.getargspec if six.PY2 else inspect.signature + def _get_public_apis(inst): methods = {} for (name, value) in inspect.getmembers(inst, inspect.ismethod): @@ -98,8 +101,8 @@ class CompareBasetoModules(base.TestCase): implmethods = _get_public_apis(driverclass) for name in basemethods: - baseargs = inspect.getargspec(basemethods[name]) - implargs = inspect.getargspec(implmethods[name]) + baseargs = signature_method(basemethods[name]) + implargs = signature_method(implmethods[name]) self.assertEqual( baseargs, implargs, |