mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
fix: remove pack_dunder in remaining tree
Removes usage of pack_dunder from remaining code. Usage of pack_dunder has not been decessary since 2015.8.0
This commit is contained in:
parent
d089e810fe
commit
4878766622
13 changed files with 3 additions and 61 deletions
|
@ -75,10 +75,6 @@ def __virtual__():
|
|||
return True
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def _get_driver(profile):
|
||||
config = __salt__["config.option"]("libcloud_compute")[profile]
|
||||
cls = get_driver(config["driver"])
|
||||
|
|
|
@ -34,7 +34,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
import logging
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.compat
|
||||
from salt.utils.versions import LooseVersion as _LooseVersion
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -70,10 +69,6 @@ def __virtual__():
|
|||
return True
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def _get_driver(profile):
|
||||
config = __salt__["config.option"]("libcloud_dns")[profile]
|
||||
cls = get_driver(config["driver"])
|
||||
|
|
|
@ -74,10 +74,6 @@ def __virtual__():
|
|||
return True
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def _algorithm_maps():
|
||||
return {
|
||||
"RANDOM": Algorithm.RANDOM,
|
||||
|
|
|
@ -72,10 +72,6 @@ def __virtual__():
|
|||
return True
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def _get_driver(profile):
|
||||
config = __salt__["config.option"]("libcloud_storage")[profile]
|
||||
cls = get_driver(config["driver"])
|
||||
|
|
|
@ -50,9 +50,6 @@ Example:
|
|||
# Import Python Libs
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.compat
|
||||
|
||||
|
||||
def __virtual__():
|
||||
if "libcloud_dns.list_zones" in __salt__:
|
||||
|
@ -60,10 +57,6 @@ def __virtual__():
|
|||
return (False, "libcloud_dns module could not be loaded")
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def state_result(result, message, name, changes=None):
|
||||
if changes is None:
|
||||
changes = {}
|
||||
|
|
|
@ -51,9 +51,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
|
||||
import logging
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.compat
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -63,10 +60,6 @@ def __virtual__():
|
|||
return (False, "libcloud_loadbalancer module could not be loaded")
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def state_result(result, message, name, changes=None):
|
||||
if changes is None:
|
||||
changes = {}
|
||||
|
|
|
@ -69,9 +69,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
|
||||
import logging
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils.compat
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -81,10 +78,6 @@ def __virtual__():
|
|||
return (False, "libcloud_storage module could not be loaded")
|
||||
|
||||
|
||||
def __init__(opts):
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
|
||||
|
||||
def state_result(result, message, name, changes):
|
||||
return {"result": result, "comment": message, "name": name, "changes": changes}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ def __virtual__():
|
|||
|
||||
def __init__(opts):
|
||||
# Put logic here to instantiate underlying jobs/connections
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
pass
|
||||
|
||||
|
||||
def my_action(params):
|
||||
|
|
|
@ -51,7 +51,7 @@ def __virtual__():
|
|||
|
||||
def __init__(opts):
|
||||
# Put logic here to instantiate underlying jobs/connections
|
||||
salt.utils.compat.pack_dunder(__name__)
|
||||
pass
|
||||
|
||||
|
||||
def present(name):
|
||||
|
|
|
@ -227,11 +227,6 @@ class LibcloudComputeModuleTestCase(TestCase, LoaderModuleMockMixin):
|
|||
client = libcloud_compute._get_driver("test")
|
||||
self.assertFalse(client is None)
|
||||
|
||||
def test_init(self):
|
||||
with patch("salt.utils.compat.pack_dunder", return_value=False) as dunder:
|
||||
libcloud_compute.__init__(None)
|
||||
dunder.assert_called_with("salt.modules.libcloud_compute")
|
||||
|
||||
def _validate_node(self, node):
|
||||
self.assertEqual(node["name"], "test_node")
|
||||
self.assertEqual(node["id"], "test_id")
|
||||
|
|
|
@ -10,7 +10,7 @@ import salt.modules.libcloud_dns as libcloud_dns
|
|||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
from tests.support.mock import MagicMock, patch
|
||||
from tests.support.mock import MagicMock
|
||||
from tests.support.unit import TestCase, skipIf
|
||||
|
||||
|
||||
|
@ -42,8 +42,3 @@ class LibcloudDnsModuleTestCase(TestCase, LoaderModuleMockMixin):
|
|||
def test_module_creation(self):
|
||||
client = libcloud_dns._get_driver("test")
|
||||
self.assertFalse(client is None)
|
||||
|
||||
def test_init(self):
|
||||
with patch("salt.utils.compat.pack_dunder", return_value=False) as dunder:
|
||||
libcloud_dns.__init__(None)
|
||||
dunder.assert_called_with("salt.modules.libcloud_dns")
|
||||
|
|
|
@ -114,11 +114,6 @@ class LibcloudLoadBalancerModuleTestCase(TestCase, LoaderModuleMockMixin):
|
|||
client = libcloud_loadbalancer._get_driver("test")
|
||||
self.assertFalse(client is None)
|
||||
|
||||
def test_init(self):
|
||||
with patch("salt.utils.compat.pack_dunder", return_value=False) as dunder:
|
||||
libcloud_loadbalancer.__init__(None)
|
||||
dunder.assert_called_with("salt.modules.libcloud_loadbalancer")
|
||||
|
||||
def _validate_balancer(self, balancer):
|
||||
self.assertEqual(balancer["name"], "test_balancer")
|
||||
|
||||
|
|
|
@ -90,11 +90,6 @@ class LibcloudStorageModuleTestCase(TestCase, LoaderModuleMockMixin):
|
|||
client = libcloud_storage._get_driver("test")
|
||||
self.assertFalse(client is None)
|
||||
|
||||
def test_init(self):
|
||||
with patch("salt.utils.compat.pack_dunder", return_value=False) as dunder:
|
||||
libcloud_storage.__init__(None)
|
||||
dunder.assert_called_with("salt.modules.libcloud_storage")
|
||||
|
||||
def test_list_containers(self):
|
||||
containers = libcloud_storage.list_containers("test")
|
||||
self.assertEqual(len(containers), 1)
|
||||
|
|
Loading…
Add table
Reference in a new issue