Skip to content
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

Back-port #29467 to 2015.5 #31689

Merged
merged 1 commit into from
Mar 6, 2016
Merged

Back-port #29467 to 2015.5 #31689

merged 1 commit into from
Mar 6, 2016

Conversation

rallytime
Copy link
Contributor

Back-port #29467 to 2015.5 as requested in #30559. The bug this is fixing is present on the 2015.5 branch, too.

using module.run to check if port 53 is opened on localhost, using module network.connect  
example state: 
~~~
network.connect:
  module.run: 
    - host: {{ salt['network.ipaddrs']()|join }}
    - port: 53
    - port: 1234
    - proto: udp

unexpected behavior: 
module.run will always succeed, 
even If network.connect returns result: False

example output (before the change): 
----------
          ID: network.connect
    Function: module.run
      Result: True
     Comment: Module function network.connect executed
     Started: 22:28:29.475623
    Duration: 0.001 ms
     Changes:   
              ----------
              ret:
                  ----------
                  comment:
                      Unable to connect to 10.0.0.50 (10.0.0.50) on tcp port 1234
                  result:
                      False

Proposal: 
Proposing to check changes_ret.result and return it as a result before trying to check changes_ret.retcode 

tested expected behavior: 
~~~
----------
          ID: network.connect
    Function: module.run
      Result: False
     Comment: Module function network.connect executed
     Started: 22:50:25.149832
    Duration: 9.964 ms
     Changes:   
              ----------
              ret:
                  ----------
                  comment:
                      Unable to connect to 10.0.0.50 (10.0.0.50) on tcp port 1234
                  result:
                      False

----------
          ID: network.connect
    Function: module.run
      Result: True
     Comment: Module function network.connect executed
     Started: 22:50:07.129629
    Duration: 0.205 ms
     Changes:   
              ----------
              ret:
                  ----------
                  comment:
                      Successfully connected to 10.0.0.50 (10.0.0.50) on tcp port 53
                  result:
                      True
@rallytime
Copy link
Contributor Author

Go Go Jenkins!

cro added a commit that referenced this pull request Mar 6, 2016
@cro cro merged commit 9162925 into saltstack:2015.5 Mar 6, 2016
@rallytime rallytime deleted the bp-29467 branch March 7, 2016 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants