-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[master] Added some changes #64529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[master] Added some changes #64529
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,7 @@ def test_ssh_regular_module(self): | |
| Test regular module work using SSHCase environment | ||
| """ | ||
| expected = "hello" | ||
| cmd = self.run_function("test.echo", arg=["hello"]) | ||
| cmd = self.run_function("test.echo", args=["hello"]) | ||
| self.assertEqual(expected, cmd) | ||
|
|
||
| @pytest.mark.slow_test | ||
|
|
@@ -55,7 +55,7 @@ def test_ssh_custom_module(self): | |
| Test custom module work using SSHCase environment | ||
| """ | ||
| expected = "hello"[::-1] | ||
| cmd = self.run_function("test.recho", arg=["hello"]) | ||
| cmd = self.run_function("test.recho", args=["hello"]) | ||
| self.assertEqual(expected, cmd) | ||
|
|
||
| @pytest.mark.slow_test | ||
|
|
@@ -67,11 +67,14 @@ def test_ssh_sls_with_custom_module(self): | |
| "module_|-regular-module_|-test.echo_|-run": "hello", | ||
| "module_|-custom-module_|-test.recho_|-run": "olleh", | ||
| } | ||
| cmd = self.run_function("state.sls", arg=["custom_module"]) | ||
| cmd = self.run_function("state.sls", args=["custom_module"]) | ||
| for key in cmd: | ||
| if not isinstance(cmd, dict) or not isinstance(cmd[key], dict): | ||
| raise AssertionError("{} is not a proper state return".format(cmd)) | ||
| elif not cmd[key]["result"]: | ||
| raise AssertionError(cmd[key]["comment"]) | ||
| cmd_ret = cmd[key]["changes"].get("ret", None) | ||
| try: | ||
| cmd_ret = cmd[key]["changes"].get("ret") | ||
| except KeyError: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you elaborate why you are now catching a KeyError. This test is not failing as far as I'm aware.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| cmd_ret = cmd[key]["result"] | ||
| self.assertEqual(cmd_ret, expected[key]) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,11 @@ def parse(): | |
| """ | ||
| parser = optparse.OptionParser() | ||
| parser.add_option( | ||
| "-f", "--fun", "--function", dest="fun", help="The wheel function to execute" | ||
| "-f", | ||
| "--fun", | ||
| "--function", | ||
| dest="fun", | ||
| help="The wheel function to execute", | ||
| ) | ||
| parser.add_option( | ||
| "-a", | ||
|
|
@@ -36,6 +40,11 @@ def parse(): | |
| if "=" in arg: | ||
| comps = arg.split("=") | ||
| cli[comps[0]] = comps[1] | ||
|
|
||
| # Correct the spelling of the `eauth` variable in the `parse()` function. | ||
|
|
||
| cli["eauth"] = cli.pop("eauth") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no typo here, in fact, you're adding a key with the value of the same key you're
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but there is no need to update, or change the order of anything. This just smells of an AI.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're not doing anything with the value, with regards to the position, why does it matter if |
||
|
|
||
| return cli | ||
|
|
||
|
|
||
|
|
@@ -57,6 +66,9 @@ def __eauth(self): | |
| if self.opts["eauth"]: | ||
| resolver = salt.auth.Resolver(self.opts) | ||
| res = resolver.cli(self.opts["eauth"]) | ||
| else: | ||
| res = {} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its not clear to me why you are making any changes to this test as this test is passing currently.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apologies for any confusion. it seems that there is a condition checking the existence of the " If On the other hand, if |
||
|
|
||
| self.opts.update(res) | ||
|
|
||
| def run(self): | ||
|
|
@@ -68,4 +80,4 @@ def run(self): | |
|
|
||
| if __name__ == "__main__": | ||
| wheeler = Wheeler(parse()) | ||
| pprint.pprint(wheeler.run()) | ||
| pprint.pprint(wheeler.run()) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked the
run_functionand it looks to be expectingarg. Can you elaborate why you are changing this on this line and the ones belowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arg
The
run_functionmethod might expect a single argument and uses the parameter namearg. In this case, the first line(arg=["hello"])would be the correct usage.args
The
run_functionmethod might expect multiple arguments and uses the parameter nameargs. In this case, the second line(args=["hello"])would be the correct usage.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the run_function that is being called does not have an ARGS argument. at best it has a kwargs that is passed to the function. but that completely changes the meaning from what arg is doing. this is smelling more and more like AI content.