Bug 1567845 - apb init name followed by / does not work
Summary: apb init name followed by / does not work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.10.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.10.0
Assignee: Dylan Murray
QA Contact: sunzhaohua
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-16 09:47 UTC by sunzhaohua
Modified: 2018-07-30 19:13 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-07-30 19:13:03 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1816 None None None 2018-07-30 19:13:21 UTC

Description sunzhaohua 2018-04-16 09:47:48 UTC
Description of problem:

Run `apb init my-01-apb` to init a directory.
Then run `apb init my-01-apb/ --force` to re-init the directory. Because press Tab key, the apb name followed by /.

Then run `apb init -h ` show error.

Version-Release number of selected component (if applicable):
openshift:3.10
apb: 1.2.1

How reproducible:
Always

Steps to Reproduce:
1.$ apb init my-01-apb

2.typing `apb init my-01-apb/` with `--force` option.
$ apb init my-01-apb/ --force 

3. $ ll
total 0

4. $ apb init -h
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/apb", line 9, in <module>
    load_entry_point('apb==1.2.1', 'console_scripts', 'apb')()
  File "/usr/lib/python2.7/site-packages/apb/cli.py", line 619, in main
    default=os.getcwd()
OSError: [Errno 2] No such file or directory

Actual results
`apb init` failed to handle the folder ending with "/".
After run `apb init my-01-apb` with `-force` option, run any command get traceback. e.g 

$ apb init -h
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/apb", line 9, in <module>
    load_entry_point('apb==1.2.1', 'console_scripts', 'apb')()
  File "/usr/lib/python2.7/site-packages/apb/cli.py", line 619, in main
    default=os.getcwd()
OSError: [Errno 2] No such file or directory


Expected results:
The `apb init ` should handle the folders ending with "/".

Additional info:

Comment 2 David Zager 2018-04-27 23:40:27 UTC
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=679545

brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/apb-tools:v3.10.0-0.16.0.4

Comment 3 sunzhaohua 2018-04-28 06:06:48 UTC
Verified with latest image in brew. 
Will wait for the rpm ready to double verify.

# apb init my-01-apb
groupadd: GID '0' already exists
usermod: group 'apb' does not exist
Initializing /mnt/my-01-apb for an APB.
Generating playbook files
Successfully initialized project directory at: /mnt/my-01-apb
Please run *apb prepare* inside of this directory after editing files.

# apb init my-01-apb/ --force
groupadd: GID '0' already exists
usermod: group 'apb' does not exist
Initializing /mnt/my-01-apb for an APB.
Generating playbook files
Successfully initialized project directory at: /mnt/my-01-apb
Please run *apb prepare* inside of this directory after editing files.

# cd my-01-apb/

# apb prepare
groupadd: GID '0' already exists
usermod: group 'apb' does not exist
Finished writing dockerfile.

Comment 4 sunzhaohua 2018-05-03 03:41:48 UTC
Verified 

# apb version
Version: apb-1.2.5

# apb init my-01-apb
Initializing /root/my-01-apb for an APB.
Generating playbook files
Successfully initialized project directory at: /root/my-01-apb
Please run *apb prepare* inside of this directory after editing files.

# apb init my-01-apb/ --force
Initializing /root/my-01-apb for an APB.
Generating playbook files
Successfully initialized project directory at: /root/my-01-apb
Please run *apb prepare* inside of this directory after editing files.

# cd my-01-apb/

# apb prepare
Finished writing dockerfile.

Comment 6 errata-xmlrpc 2018-07-30 19:13:03 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/RHBA-2018:1816


Note You need to log in before you can comment on or make changes to this bug.