mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Remaining requested review changes missed in #60494
This commit is contained in:
parent
84b5e4fa5b
commit
83b872754f
8 changed files with 37 additions and 47 deletions
|
@ -3,7 +3,6 @@ The Salt Key backend API and interface used by the CLI. The Key class can be
|
|||
used to manage salt keys directly without interfacing with the CLI.
|
||||
"""
|
||||
|
||||
|
||||
import fnmatch
|
||||
import itertools
|
||||
import logging
|
||||
|
@ -656,7 +655,8 @@ class Key:
|
|||
continue
|
||||
try:
|
||||
shutil.move(
|
||||
key_path, os.path.join(self.opts["pki_dir"], self.ACC, key),
|
||||
key_path,
|
||||
os.path.join(self.opts["pki_dir"], self.ACC, key),
|
||||
)
|
||||
eload = {"result": True, "act": "accept", "id": key}
|
||||
self.event.fire_event(eload, salt.utils.event.tagify(prefix="key"))
|
||||
|
|
|
@ -236,7 +236,7 @@ def pool_present(
|
|||
else:
|
||||
ret[
|
||||
"comment"
|
||||
] = "An existing identity pool named {} with id {}will be updated.".format(
|
||||
] = "An existing identity pool named {} with id {} will be updated.".format(
|
||||
IdentityPoolName, IdentityPoolId
|
||||
)
|
||||
ret["result"] = None
|
||||
|
|
|
@ -430,7 +430,7 @@ def storage_policies_configured(name, policies):
|
|||
service_instance=si,
|
||||
)
|
||||
comments.append(
|
||||
"Updated the storage policy '{}'in vCenter '{}'".format(
|
||||
"Updated the storage policy '{}' in vCenter '{}'".format(
|
||||
policy["name"], vcenter
|
||||
)
|
||||
)
|
||||
|
|
|
@ -37,7 +37,7 @@ def which_bin(exes):
|
|||
def wrapped(*args, **kwargs):
|
||||
if salt.utils.path.which_bin(exes) is None:
|
||||
raise CommandNotFoundError(
|
||||
"None of provided binaries({}) was not found in $PATH.".format(
|
||||
"None of provided binaries({}) were found in $PATH.".format(
|
||||
["'{}'".format(exe) for exe in exes]
|
||||
)
|
||||
)
|
||||
|
|
|
@ -311,7 +311,9 @@ except (ImportError, AttributeError):
|
|||
|
||||
|
||||
class DefaultOrderedDict(OrderedDict):
|
||||
"Dictionary that remembers insertion order and"
|
||||
"""
|
||||
Dictionary that remembers insertion order
|
||||
"""
|
||||
|
||||
def __init__(self, default_factory=None, *a, **kw):
|
||||
if default_factory is not None and not isinstance(default_factory, Callable):
|
||||
|
|
|
@ -66,7 +66,7 @@ class ArgParser:
|
|||
default="eth0",
|
||||
dest="iface",
|
||||
required=False,
|
||||
help="the interface to dump themaster runs on(default:eth0)",
|
||||
help="The interface to dump the master runs on(default:eth0)",
|
||||
)
|
||||
|
||||
self.main_parser.add_argument(
|
||||
|
@ -75,7 +75,7 @@ class ArgParser:
|
|||
default=5,
|
||||
dest="ival",
|
||||
required=False,
|
||||
help="interval for printing stats (default:5)",
|
||||
help="Interval for printing stats (default:5)",
|
||||
)
|
||||
|
||||
self.main_parser.add_argument(
|
||||
|
@ -86,7 +86,7 @@ class ArgParser:
|
|||
nargs="?",
|
||||
dest="only_ip",
|
||||
required=False,
|
||||
help="print unique IPs making new connections with SYN set",
|
||||
help="Print unique IPs making new connections with SYN set",
|
||||
)
|
||||
|
||||
def parse_args(self):
|
||||
|
|
|
@ -116,6 +116,8 @@ class ZFSMockData:
|
|||
"frag": {"edit": False, "type": "str", "values": "<percent>"},
|
||||
"fragmentation": {"edit": False, "type": "str", "values": "<percent>"},
|
||||
}
|
||||
|
||||
# fmt: off
|
||||
self.pmap_exec_zfs = {
|
||||
"retcode": 2,
|
||||
"stdout": "",
|
||||
|
@ -134,8 +136,7 @@ class ZFSMockData:
|
|||
"",
|
||||
" available NO NO <size>",
|
||||
" clones NO NO <dataset>[,...]",
|
||||
" compressratio NO NO <1.00x or higher if"
|
||||
" compressed>",
|
||||
" compressratio NO NO <1.00x or higher if compressed>",
|
||||
" creation NO NO <date>",
|
||||
" defer_destroy NO NO yes | no",
|
||||
" filesystem_count NO NO <count>",
|
||||
|
@ -144,12 +145,10 @@ class ZFSMockData:
|
|||
" mounted NO NO yes | no",
|
||||
" origin NO NO <snapshot>",
|
||||
" receive_resume_token NO NO <string token>",
|
||||
" refcompressratio NO NO <1.00x or higher if"
|
||||
" compressed>",
|
||||
" refcompressratio NO NO <1.00x or higher if compressed>",
|
||||
" referenced NO NO <size>",
|
||||
" snapshot_count NO NO <count>",
|
||||
" type NO NO filesystem | volume |"
|
||||
" snapshot | bookmark",
|
||||
" type NO NO filesystem | volume | snapshot | bookmark",
|
||||
" used NO NO <size>",
|
||||
" usedbychildren NO NO <size>",
|
||||
" usedbydataset NO NO <size>",
|
||||
|
@ -157,21 +156,15 @@ class ZFSMockData:
|
|||
" usedbysnapshots NO NO <size>",
|
||||
" userrefs NO NO <count>",
|
||||
" written NO NO <size>",
|
||||
" aclinherit YES YES discard | noallow |"
|
||||
" restricted | passthrough | passthrough-x",
|
||||
" aclmode YES YES discard | groupmask |"
|
||||
" passthrough | restricted",
|
||||
" aclinherit YES YES discard | noallow | restricted | passthrough | passthrough-x",
|
||||
" aclmode YES YES discard | groupmask | passthrough | restricted",
|
||||
" atime YES YES on | off",
|
||||
" canmount YES NO on | off | noauto",
|
||||
" casesensitivity NO YES sensitive | insensitive |"
|
||||
" mixed",
|
||||
" checksum YES YES on | off | fletcher2 |"
|
||||
" fletcher4 | sha256 | sha512 | skein | edonr",
|
||||
" compression YES YES on | off | lzjb | gzip |"
|
||||
" gzip-[1-9] | zle | lz4",
|
||||
" casesensitivity NO YES sensitive | insensitive | mixed",
|
||||
" checksum YES YES on | off | fletcher2 | fletcher4 | sha256 | sha512 | skein | edonr",
|
||||
" compression YES YES on | off | lzjb | gzip | gzip-[1-9] | zle | lz4",
|
||||
" copies YES YES 1 | 2 | 3",
|
||||
" dedup YES YES on | off | verify |"
|
||||
" sha256[,verify], sha512[,verify], skein[,verify], edonr,verify",
|
||||
" dedup YES YES on | off | verify | sha256[,verify], sha512[,verify], skein[,verify], edonr,verify",
|
||||
" devices YES YES on | off",
|
||||
" exec YES YES on | off",
|
||||
" filesystem_limit YES NO <count> | none",
|
||||
|
@ -179,8 +172,7 @@ class ZFSMockData:
|
|||
" mlslabel YES YES <sensitivity label>",
|
||||
" mountpoint YES YES <path> | legacy | none",
|
||||
" nbmand YES YES on | off",
|
||||
" normalization NO YES none | formC | formD |"
|
||||
" formKC | formKD",
|
||||
" normalization NO YES none | formC | formD | formKC | formKD",
|
||||
" primarycache YES YES all | none | metadata",
|
||||
" quota YES NO <size> | none",
|
||||
" readonly YES YES on | off",
|
||||
|
@ -191,17 +183,13 @@ class ZFSMockData:
|
|||
" reservation YES NO <size> | none",
|
||||
" secondarycache YES YES all | none | metadata",
|
||||
" setuid YES YES on | off",
|
||||
" sharenfs YES YES on | off | share(1M)"
|
||||
" options",
|
||||
" sharesmb YES YES on | off | sharemgr(1M)"
|
||||
" options",
|
||||
" sharenfs YES YES on | off | share(1M) options",
|
||||
" sharesmb YES YES on | off | sharemgr(1M) options",
|
||||
" snapdir YES YES hidden | visible",
|
||||
" snapshot_limit YES NO <count> | none",
|
||||
" sync YES YES standard | always |"
|
||||
" disabled",
|
||||
" sync YES YES standard | always | disabled",
|
||||
" utf8only NO YES on | off",
|
||||
" version YES NO 1 | 2 | 3 | 4 | 5 |"
|
||||
" current",
|
||||
" version YES NO 1 | 2 | 3 | 4 | 5 | current",
|
||||
" volblocksize NO YES 512 to 128k, power of 2",
|
||||
" volsize YES NO <size>",
|
||||
" vscan YES YES on | off",
|
||||
|
@ -213,11 +201,9 @@ class ZFSMockData:
|
|||
" groupquota@... YES NO <size> | none",
|
||||
" written@<snap> NO NO <size>",
|
||||
"",
|
||||
"Sizes are specified in bytes with standard units such as K, M, G,"
|
||||
" etc.",
|
||||
"Sizes are specified in bytes with standard units such as K, M, G, etc.",
|
||||
"",
|
||||
"User-defined properties can be specified by using a name"
|
||||
" containing a colon (:).",
|
||||
"User-defined properties can be specified by using a name containing a colon (:).",
|
||||
"",
|
||||
"The {user|group}{used|quota}@ properties must be appended with",
|
||||
"a user or group specifier of one of these forms:",
|
||||
|
@ -228,6 +214,7 @@ class ZFSMockData:
|
|||
]
|
||||
),
|
||||
}
|
||||
# fmt: on
|
||||
self.pmap_zfs = {
|
||||
"origin": {
|
||||
"edit": False,
|
||||
|
|
|
@ -5,17 +5,18 @@
|
|||
import base64
|
||||
from contextlib import contextmanager
|
||||
|
||||
import pytest
|
||||
import salt.modules.kubernetesmod as kubernetesmod
|
||||
import salt.states.kubernetes as kubernetes
|
||||
import salt.utils.stringutils
|
||||
from salt.states import kubernetes
|
||||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
from tests.support.mock import MagicMock, patch
|
||||
from tests.support.unit import TestCase, skipIf
|
||||
from tests.support.unit import TestCase
|
||||
|
||||
|
||||
@skipIf(
|
||||
kubernetes is False,
|
||||
"Probably Kubernetes client lib is not installed. "
|
||||
" Skipping test_kubernetes.py",
|
||||
@pytest.mark.skipif(
|
||||
kubernetesmod.HAS_LIBS is False,
|
||||
reason="Probably Kubernetes client lib is not installed. Skipping test_kubernetes.py",
|
||||
)
|
||||
class KubernetesTestCase(TestCase, LoaderModuleMockMixin):
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue