Bug 734910

Summary: ccs should not traceback when passing a directory with '-f'
Product: Red Hat Enterprise Linux 6 Reporter: Chris Feist <cfeist>
Component: ricciAssignee: Chris Feist <cfeist>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: high Docs Contact:
Priority: medium    
Version: 6.3CC: cluster-maint, rsteiger
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ricci-0.16.2-48.el6 Doc Type: Bug Fix
Doc Text:
No Documentation Needed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 14:13:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 756082    

Description Chris Feist 2011-08-31 20:11:55 UTC
Description of problem:
ccs gives an unhelpful error when passing a directory to '-f'

Version-Release number of selected component (if applicable):
ccs-0.18.7-1.fc15.i686

How reproducible:
Always

Steps to Reproduce:
1. Create directory 'test'
2. ccs -f test createcluster
3. Error
  
Actual results:
Traceback (most recent call last):
  File "/usr/sbin/ccs", line 1820, in <module>
    main(sys.argv[1:])
  File "/usr/sbin/ccs", line 224, in main
    if (createcluster): create_cluster(clustername)
  File "/usr/sbin/ccs", line 689, in create_cluster
    set_cluster_conf(xml, False)
  File "/usr/sbin/ccs", line 1659, in set_cluster_conf
    f = open(filename, 'w')
IOError: [Errno 21] Is a directory: 'test'


Expected results:
Error: '-f' requires a filename, not a directory

Comment 3 Chris Feist 2012-02-03 23:12:33 UTC
Replicated:

[root@amoco-01 ~]# ccs -f /tmp --createcluster test
Traceback (most recent call last):
  File "/usr/sbin/ccs", line 2144, in <module>
    main(sys.argv[1:])
  File "/usr/sbin/ccs", line 256, in main
    if (createcluster): create_cluster(clustername)
  File "/usr/sbin/ccs", line 786, in create_cluster
    set_cluster_conf(xml, False)
  File "/usr/sbin/ccs", line 1970, in set_cluster_conf
    f = open(filename, 'w')
IOError: [Errno 21] Is a directory: '/tmp'

With Fix:
[cfeist@gold ccs]$ ./ccs -i  -f /tmp --createcluster test
Error: Unable to write file: '/tmp', Is a directory

Commit:
https://github.com/feist/ccs/commit/b4b658ee8bb35a08ad9973fb08086532fb98f286

Comment 4 Chris Feist 2012-02-28 00:14:50 UTC
Using ricci-0.16.2-48.el6:


[root@ask-04 tmp]# ccs -f /tmp/ --createcluster test
Error: Unable to write file: '/tmp/', Is a directory

Comment 6 Chris Feist 2012-03-15 19:49:28 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation Needed.

Comment 8 errata-xmlrpc 2012-06-20 14:13:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0898.html