mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Check for extra arguments to '--doc' and fail. Fixes #12261.
This commit is contained in:
parent
5b790dbb79
commit
762d0b1e24
2 changed files with 9 additions and 1 deletions
|
@ -1626,7 +1626,8 @@ class SaltCMDOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
|
|||
self.args.insert(1, 'sys.doc')
|
||||
if self.args[1] != 'sys.doc':
|
||||
self.args.insert(1, 'sys.doc')
|
||||
self.args[2] = self.args[2]
|
||||
if len(self.args) > 3:
|
||||
self.error('You can only get documentation for one method at one time.')
|
||||
|
||||
if self.options.list:
|
||||
try:
|
||||
|
|
|
@ -219,6 +219,13 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
data = self.run_salt('\'*\' sys.doc user')
|
||||
self.assertIn('user.add:', data)
|
||||
|
||||
def test_salt_documentation_too_many_arguments(self):
|
||||
'''
|
||||
Test to see if passing additional arguments shows an error
|
||||
'''
|
||||
data = self.run_salt('-d minion salt ldap.search "filter=ou=People"', catch_stderr=True)
|
||||
self.assertIn('You can only get documentation for one method at one time', '\n'.join(data[1]))
|
||||
|
||||
def test_issue_7754(self):
|
||||
old_cwd = os.getcwd()
|
||||
config_dir = os.path.join(integration.TMP, 'issue-7754')
|
||||
|
|
Loading…
Add table
Reference in a new issue