Bug 1450949

Summary: [Bug]Executing "puppet agent disable" and it's not throwing any error message
Product: Red Hat Satellite Reporter: rakesh kumar <rakumar>
Component: PuppetAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NEXTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.8CC: bbuckingham, jcallaha, misterbonnie, nshaik, riehecky
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: https://tickets.puppetlabs.com/browse/PUP-4776
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-02 09:39:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
agent.rb patch none

Description rakesh kumar 2017-05-15 12:50:08 UTC
Description of problem: Executing "puppet agent disable" and it's not throwing any error message. 

Customer executed"# puppet agent disable" across a set of nodes to disbale puppet and received no error. The correct command was 'puppet agent --disable'.  As a result configuration changes were taking place when the should not have.


Version-Release number of selected component (if applicable):
puppet-3.8.6-2.el7sat.noarch

How reproducible: Always


Steps to Reproduce:
1. Execute below command on the system to disable puppet:
# puppet agent disable

Actual results:
command executed without any error, with exit status 0:

[root@client ~]# rpm -qa puppet
puppet-3.8.6-2.el7sat.noarch
[root@client ~]# puppet agent disable
[root@client ~]# echo $?
0

Expected results:
It should throw any error message like, not a valid option.

Additional info:

Comment 3 Nagoor Shaik 2017-05-31 06:28:11 UTC
Created attachment 1283623 [details]
agent.rb patch

Comment 4 Nagoor Shaik 2017-05-31 06:34:40 UTC
Created patch from upstream MR, and applied works on puppet version puppet-3.8.6

To apply the patch follow below steps 

1) Download the patch attached to this Bugzilla to /tmp location

2) Execute following commands on the puppet client 

  # /usr/share/ruby/vendor_ruby/puppet/application
  # patch -p1 agent.rb < /tmp/agent.rb.patch
 
3) Verify 
    
  # puppet agent disable
  Error: Could not prepare for execution: The puppet agent command does not take parameters

  # echo $?
  1

  # puppet agent --disable
  # echo $?
   0

-- nagoor

Comment 5 Nagoor Shaik 2017-05-31 06:43:39 UTC
Step2, there is a typo in my command 

 # cd /usr/share/ruby/vendor_ruby/puppet/application
 # patch -p1 agent.rb < /tmp/agent.rb.patch