]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: rename import from cd to _cephadm
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 27 Sep 2022 18:50:44 +0000 (14:50 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 27 Sep 2022 18:53:38 +0000 (14:53 -0400)
The `cd` name is an abbreviation of an obsolete name for cephadm.
As this is not widely known it could be confusing or conflict with
other common terms like `cd` for "change dir" or "compact disc".
Therefore we rename it to something much clearer.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/tests/test_networks.py

index 8a4e74b40deacc6762638ed5873a7670add653c6..7c0575046c9465824a45901202b6214e4e965a9d 100644 (file)
@@ -6,7 +6,7 @@ import pytest
 
 from tests.fixtures import with_cephadm_ctx, cephadm_fs, import_cephadm
 
-cd = import_cephadm()
+_cephadm = import_cephadm()
 
 
 class TestCommandListNetworks:
@@ -69,7 +69,7 @@ class TestCommandListNetworks:
         ),
     ])
     def test_parse_ipv4_route(self, test_input, expected):
-        assert cd._parse_ipv4_route(test_input) == expected
+        assert _cephadm._parse_ipv4_route(test_input) == expected
 
     @pytest.mark.parametrize("test_routes, test_ips, expected", [
         (
@@ -222,12 +222,12 @@ class TestCommandListNetworks:
         ),
     ])
     def test_parse_ipv6_route(self, test_routes, test_ips, expected):
-        assert cd._parse_ipv6_route(test_routes, test_ips) == expected
+        assert _cephadm._parse_ipv6_route(test_routes, test_ips) == expected
 
-    @mock.patch.object(cd, 'call_throws', return_value=('10.4.0.1 dev tun0 proto kernel scope link src 10.4.0.2 metric 50\n', '', ''))
+    @mock.patch.object(_cephadm, 'call_throws', return_value=('10.4.0.1 dev tun0 proto kernel scope link src 10.4.0.2 metric 50\n', '', ''))
     def test_command_list_networks(self, cephadm_fs, capsys):
         with with_cephadm_ctx([]) as ctx:
-            cd.command_list_networks(ctx)
+            _cephadm.command_list_networks(ctx)
             assert json.loads(capsys.readouterr().out) == {
                 '10.4.0.1/32': {'tun0': ['10.4.0.2']}
             }