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

"Config Create" Attempts to Overwrite Default Configuration File #44

Open
mattroark opened this issue Nov 22, 2019 · 2 comments
Open

"Config Create" Attempts to Overwrite Default Configuration File #44

mattroark opened this issue Nov 22, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@mattroark
Copy link

A permissions error is encountered when executing config create as:

  1. A unique filename is not generated as per the config name passed.
  2. The default configuration file is owned by root:root.
ubuntu@pmkft-cli:~$ pf9ctl config create
Config name: pmkft-1573762631
Platform9 management URL: https://pmkft-1573762631.platform9.horse/
Platform9 user: matthew.roark@platform9.com
Platform9 password:
Platform9 region: RegionOne
Platform9 tenant [service]: service
Traceback (most recent call last):
  File "/usr/bin/pf9ctl", line 8, in <module>
    sys.exit(cli())
  File "/opt/pf9/cli/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/opt/pf9/cli/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/opt/pf9/cli/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/pf9/cli/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/pf9/cli/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/pf9/cli/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/opt/pf9/cli/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/pf9/cli/lib/python3.6/site-packages/pf9/config/commands.py", line 54, in create
    shutil.copyfile(pf9_exp_conf_dir + 'express.conf', pf9_exp_conf_dir + filename)
  File "/usr/lib/python3.6/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/home/ubuntu/pf9/pf9-express/config/pf9-express.conf'
ubuntu@pmkft-cli:~$ stat /home/ubuntu/pf9/pf9-express/config/pf9-express.conf
  File: /home/ubuntu/pf9/pf9-express/config/pf9-express.conf
  Size: 265       	Blocks: 8          IO Block: 4096   regular file
Device: fc01h/64513d	Inode: 272636      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-11-22 21:43:43.298790878 +0000
Modify: 2019-11-22 21:43:43.298790878 +0000
Change: 2019-11-22 21:43:43.298790878 +0000
 Birth: -
@mattroark mattroark added the bug Something isn't working label Nov 22, 2019
@mattroark
Copy link
Author

Note that I initially ran the CLI setup, i.e. bash ./cli-setup.sh -t, which generated the file.

@mattroark
Copy link
Author

Additionally, two files are generated:

ubuntu@pmkft-cli:~$ ls -ltr /home/ubuntu/pf9/pf9-express/config
total 8
-rw-r--r-- 1 root   root   265 Nov 22 21:43 pf9-express.conf
-rw-rw-r-- 1 ubuntu ubuntu 274 Nov 22 21:43 express.conf

I expect that only one, express.conf, was intended to be used. considering that file has the appropriate permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant