mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Lint fixes
This commit is contained in:
parent
d37f7e4f04
commit
bc9e3acef3
@ -152,7 +152,7 @@ def rpc(cmd=None, dest=None, **kwargs):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt 'device' junos.rpc get_config /var/log/config.txt text filter='<configuration><system/></configuration>'
|
||||
salt 'device' junos.rpc get_config /var/log/config.txt format=text filter='<configuration><system/></configuration>'
|
||||
salt 'device' junos.rpc get-interface-information /home/user/interface.xml interface_name='lo0' terse=True
|
||||
salt 'device' junos.rpc get-chassis-inventory
|
||||
'''
|
||||
@ -605,7 +605,7 @@ def cli(command=None, **kwargs):
|
||||
|
||||
salt 'device_name' junos.cli 'show system commit'
|
||||
salt 'device_name' junos.cli 'show version' dev_timeout=40
|
||||
salt 'device_name' junos.cli 'show system alarms' xml dest=/home/user/cli_output.txt
|
||||
salt 'device_name' junos.cli 'show system alarms' format=xml dest=/home/user/cli_output.txt
|
||||
'''
|
||||
conn = __proxy__['junos.conn']()
|
||||
|
||||
|
@ -971,7 +971,7 @@ def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): # pylint: disable=un
|
||||
|
||||
def list_repos(**kwargs): # pylint: disable=unused-argument
|
||||
'''
|
||||
Lists all repos on /etc/opkg/\*.conf
|
||||
Lists all repos on ``/etc/opkg/*.conf``
|
||||
|
||||
CLI Example:
|
||||
|
||||
@ -1008,7 +1008,7 @@ def list_repos(**kwargs): # pylint: disable=unused-argument
|
||||
|
||||
def get_repo(alias, **kwargs): # pylint: disable=unused-argument
|
||||
'''
|
||||
Display a repo from the /etc/opkg/\*.conf
|
||||
Display a repo from the ``/etc/opkg/*.conf``
|
||||
|
||||
CLI Examples:
|
||||
|
||||
@ -1079,7 +1079,7 @@ def _mod_repo_in_file(alias, repostr, filepath):
|
||||
|
||||
def del_repo(alias, **kwargs): # pylint: disable=unused-argument
|
||||
'''
|
||||
Delete a repo from /etc/opkg/\*.conf
|
||||
Delete a repo from ``/etc/opkg/*.conf``
|
||||
|
||||
If the file does not contain any other repo configuration, the file itself
|
||||
will be deleted.
|
||||
|
@ -82,7 +82,6 @@ __func_alias__ = {
|
||||
}
|
||||
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only works on Windows systems with PyWin32
|
||||
|
@ -502,7 +502,7 @@ def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name
|
||||
continent to a different resource.
|
||||
- You can't create two geolocation resource record sets that specify the same geographic
|
||||
location.
|
||||
- The value \* in the CountryCode element matches all geographic locations that aren't
|
||||
- The value ``*`` in the CountryCode element matches all geographic locations that aren't
|
||||
specified in other geolocation resource record sets that have the same values for the
|
||||
Name and Type elements.
|
||||
- Geolocation works by mapping IP addresses to locations. However, some IP addresses
|
||||
@ -510,9 +510,9 @@ def rr_present(name, HostedZoneId=None, DomainName=None, PrivateZone=False, Name
|
||||
record sets that cover all seven continents, Amazon Route 53 will receive some DNS
|
||||
queries from locations that it can't identify. We recommend that you
|
||||
create a resource record set for which the value of CountryCode is
|
||||
\*, which handles both queries that come from locations for which you
|
||||
``*``, which handles both queries that come from locations for which you
|
||||
haven't created geolocation resource record sets and queries from IP
|
||||
addresses that aren't mapped to a location. If you don't create a \*
|
||||
addresses that aren't mapped to a location. If you don't create a ``*``
|
||||
resource record set, Amazon Route 53 returns a "no answer" response
|
||||
for queries from those locations.
|
||||
- You can't create non-geolocation resource record sets that have the same values for the
|
||||
|
@ -91,7 +91,7 @@ def present(name, Name=None,
|
||||
not provided.
|
||||
|
||||
ScheduleExpression
|
||||
The scheduling expression. For example, "cron(0 20 \* \* ? \*)",
|
||||
The scheduling expression. For example, ``cron(0 20 * * ? *)``,
|
||||
"rate(5 minutes)"
|
||||
|
||||
EventPattern
|
||||
|
@ -288,10 +288,10 @@ def install_config(name, **kwargs):
|
||||
|
||||
name
|
||||
Path where the configuration/template file is present. If the file has
|
||||
a '\*.conf' extension, the content is treated as text format. If the
|
||||
file has a '\*.xml' extension, the content is treated as XML format. If
|
||||
the file has a '\*.set' extension, the content is treated as Junos OS
|
||||
'set' commands
|
||||
a ``*.conf`` extension, the content is treated as text format. If the
|
||||
file has a ``*.xml`` extension, the content is treated as XML format. If
|
||||
the file has a ``*.set`` extension, the content is treated as Junos OS
|
||||
``set`` commands
|
||||
|
||||
template_vars
|
||||
The dictionary of data for the jinja variables present in the jinja
|
||||
@ -465,10 +465,10 @@ def load(name, **kwargs):
|
||||
|
||||
name
|
||||
Path where the configuration/template file is present. If the file has
|
||||
a '\*.conf' extension, the content is treated as text format. If the
|
||||
file has a '\*.xml' extension, the content is treated as XML format. If
|
||||
the file has a '\*.set' extension, the content is treated as Junos OS
|
||||
'set' commands.
|
||||
a ``*.conf`` extension, the content is treated as text format. If the
|
||||
file has a ``*.xml`` extension, the content is treated as XML format. If
|
||||
the file has a ``*.set`` extension, the content is treated as Junos OS
|
||||
``set`` commands.
|
||||
|
||||
overwrite : False
|
||||
Set to ``True`` if you want this file is to completely replace the
|
||||
|
@ -501,7 +501,7 @@ class Test_Junos_Module(TestCase, LoaderModuleMockMixin, XMLEqualityMixin):
|
||||
'confirm': 2, '__pub_fun': 'junos.rollback',
|
||||
'__pub_jid': '20170221184518526067', '__pub_tgt': 'mac_min',
|
||||
'__pub_tgt_type': 'glob', '__pub_ret': ''}
|
||||
junos.rollback(2, **args)
|
||||
junos.rollback(id=2, **args)
|
||||
mock_rollback.assert_called_with(2)
|
||||
mock_commit.assert_called_with(confirm=2)
|
||||
|
||||
@ -646,7 +646,7 @@ class Test_Junos_Module(TestCase, LoaderModuleMockMixin, XMLEqualityMixin):
|
||||
|
||||
def test_diff_with_arg(self):
|
||||
with patch('jnpr.junos.utils.config.Config.diff') as mock_diff:
|
||||
junos.diff(2)
|
||||
junos.diff(id=2)
|
||||
mock_diff.assert_called_with(rb_id=2)
|
||||
|
||||
def test_diff_exception(self):
|
||||
@ -702,7 +702,7 @@ class Test_Junos_Module(TestCase, LoaderModuleMockMixin, XMLEqualityMixin):
|
||||
|
||||
def test_cli_with_format_as_empty_string(self):
|
||||
with patch('jnpr.junos.device.Device.cli') as mock_cli:
|
||||
junos.cli('show version', '')
|
||||
junos.cli('show version', format='')
|
||||
mock_cli.assert_called_with('show version', 'text', warning=False)
|
||||
|
||||
def test_cli(self):
|
||||
@ -1491,7 +1491,7 @@ class Test_Junos_Module(TestCase, LoaderModuleMockMixin, XMLEqualityMixin):
|
||||
'<rpc-reply>text rpc reply</rpc-reply>')
|
||||
m = mock_open()
|
||||
with patch('salt.modules.junos.fopen', m, create=True):
|
||||
junos.rpc('get-chassis-inventory', '/path/to/file', 'text')
|
||||
junos.rpc('get-chassis-inventory', '/path/to/file', format='text')
|
||||
handle = m()
|
||||
handle.write.assert_called_with('text rpc reply')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user