PaloAltoNetworks / prismacloud-cli

The Prisma Cloud CLI is a command line interface for Prisma Cloud by Palo Alto Networks.
MIT License
37 stars 30 forks source link

error when confirming community supported #84

Closed timberbee closed 1 year ago

timberbee commented 1 year ago

Describe the bug

When I run pc version and try to answer yes to the #Community Supported verbage, I get a Traceback error. (pcclitest) ➜ pcclitest pc version zsh: correct 'pc' to 'cp' [nyae]? n

Community Supported

This template/solution is released under an as-is, best effort, support policy. These scripts should be seen as community supported and Palo Alto Networks will contribute our expertise as and when possible. We do not provide technical support or help in using or troubleshooting the components of the project through our normal support options such as Palo Alto Networks support teams, or ASC (Authorized Support Centers) partners and backline support options. The underlying product used (Prisma Cloud) by the scripts or templates are still supported, but the support is only for the product functionality and not for help in deploying or using the template or script itself.

Unless explicitly tagged, all projects or work posted in our GitHub repository (at https://github.com/PaloAltoNetworks) or sites other than our official Downloads page on https://support.paloaltonetworks.com are provided under the best effort policy.

Type yes to confirm you have read the message above: yes Message accepted. Traceback (most recent call last): File "/Users/[someuser]/Projects/pcclitest/bin/pc", line 8, in sys.exit(cli()) File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/click/core.py", line 1651, in invoke cmd_name, cmd, args = self.resolve_command(ctx, args) File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/click_help_colors/core.py", line 101, in resolve_command cmd_name, cmd, args[1:] = super(HelpColorsMultiCommand, self).resolve_command(ctx, args) File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/click/core.py", line 1698, in resolve_command cmd = self.get_command(ctx, cmd_name) File "/Users[someuser]/Projects/pcclitest/lib/python3.9/site-packages/prismacloud/cli/init.py", line 135, in get_command mod = import(f"prismacloud.cli.{moduletype}.cmd{cmd_name}", None, None, ["cli"]) File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/prismacloud/cli/cwpp/cmd_version.py", line 4, in from prismacloud.cli.api import pc_api File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/prismacloud/cli/api.py", line 264, in pc_api.configure(map_cli_config_to_api_config()) File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/prismacloud/cli/api.py", line 33, in map_cli_config_to_api_config settings = get_cli_config() File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/prismacloud/cli/api.py", line 100, in get_cli_config community_supported() # Check if support message has been shown and accepted File "/Users/[someuser]/Projects/pcclitest/lib/python3.9/site-packages/prismacloud/cli/api.py", line 78, in community_supported with open(community_support_accepted, "w") as _accepted: FileNotFoundError: [Errno 2] No such file or directory: '/Users/[someuser]/.prismacloud/.community_supported_accepted'

Expected behavior

Should create .prismacloud hidden folder in my home folder with a .community_supported_accepted file in it.

Current behavior

It errors as above

Possible solution

I created the hidden folder and the hidden file and pc version worked

Steps to reproduce

  1. on Mac OSX 12.6 running python 3.10.7 pip3 install prismacloud-cli
  2. run pc version
  3. see it fail

Screenshots

Context

Cannot try/test prismacloud-cli

Your Environment

welcome-to-palo-alto-networks[bot] commented 1 year ago

:tada: Thanks for opening your first issue here! Welcome to the community!

dukekautington3rd commented 1 year ago

@timberbee this was fixed in the last merge. You'll have to update your prisma-cli.

https://github.com/PaloAltoNetworks/prismacloud-cli/pull/80#issue-1389711238

Please confirm this fixes the issue and then we can close.

steven-deboer commented 1 year ago

Just tested and I don't get this error.