Bug 1482046

Summary: cns-deploy retrieves wrong minor version if hostname includes "oc"
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Jaspreet Kaur <jkaur>
Component: cns-deploy-toolAssignee: Jose A. Rivera <jarrpa>
Status: CLOSED ERRATA QA Contact: Prasanth <pprakash>
Severity: high Docs Contact:
Priority: high    
Version: cns-3.4CC: hchiramm, jarrpa, kramdoss, madam, pprakash, rhs-bugs, rreddy, rtalur, torben, vinug
Target Milestone: ---Flags: kramdoss: needinfo+
Target Release: CNS 3.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cns-deploy-5.0.0-21.el7rhgs Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-11 07:12:11 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:
Bug Depends On:    
Bug Blocks: 1445448    

Description Jaspreet Kaur 2017-08-16 11:09:46 UTC
Description of problem: cns-deploy -n storage-project -g cns-topology.json
Welcome to the deployment tool for GlusterFS on Kubernetes and OpenShift.
                     
Before getting started, this script has some requirements of the execution
environment and of the container platform that you should verify.
                     
The client machine that will run this script must have:
 * Administrative access to an existing Kubernetes or OpenShift cluster
 * Access to a python interpreter 'python'
 * Access to the heketi client 'heketi-cli'
                     
Each of the nodes that will host GlusterFS must also have appropriate firewall
rules for the required GlusterFS ports:
 * 2222  - sshd (if running GlusterFS in a pod)
 * 24007 - GlusterFS Daemon
 * 24008 - GlusterFS Management
 * 49152 to 49251 - Each brick for every volume on the host requires its own
   port. For every new brick, one new port will be used starting at 49152. We
   recommend a default range of 49152-49251 on each host, though you can adjust
   this to fit your needs.
                     
In addition, for an OpenShift deployment you must:
 * Have 'cluster_admin' role on the administrative account doing the deployment
 * Add the 'default' and 'router' Service Accounts to the 'privileged' SCC
 * Have a router deployed that is configured to allow apps to access services
   running in the cluster
                     
Do you wish to proceed with deployment?

[Y]es, [N]o? [Default: Y]:
Using OpenShift CLI. 
/usr/bin/cns-deploy: line 414: [[: 5
ov: syntax error in expression (error token is "ov")
</snip>


due to line 414 in /usr/bin/cns-deploy:
oc_minor_version=$(${CLI} version | grep oc | awk '{ print $2 }' | cut -d '.' -f2)

yum info cns-deploy
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Installed Packages
Name        : cns-deploy
Arch        : x86_64
Version     : 4.0.0
Release     : 19.el7rhgs
Size        : 42 k
Repo        : installed
From repo   : rh-gluster-3-for-rhel-7-server-rpms
Summary     : Container-Native Storage deployment tool
URL         : https://github.com/gluster/gluster-kubernetes
License     : ASL 2.0
Description : cns-deploy is a tool to facilitate the deployment of a Container-Native Storage
            : solution using GlusterFS.

Actual results: It fails


Expected results: It should succeed without issue


Additional info:

Comment 6 Humble Chirammal 2017-08-29 10:48:43 UTC
Ths fix is already there in cns-deploy > v22 build.

Comment 9 Prasanth 2017-09-19 11:56:01 UTC
Verified

Comment 11 errata-xmlrpc 2017-10-11 07:12:11 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.

https://access.redhat.com/errata/RHEA-2017:2881