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

Error on zenpacklib --create command #415

Open
vikt0rs opened this issue Feb 17, 2017 · 3 comments
Open

Error on zenpacklib --create command #415

vikt0rs opened this issue Feb 17, 2017 · 3 comments

Comments

@vikt0rs
Copy link

vikt0rs commented Feb 17, 2017

Hi folks,

I'm trying to create a new ZP using documentation from https://zenpack-sdk.zenoss.com/en/latest/getting-started.html but I'm getting a strange exception during the command run. Please find trace below

[zenoss@domain ~]$ zenpacklib --create ZenPack.zenoss.PS.EMCXtremIO
Creating source directory for ZenPack.zenoss.PS.EMCXtremIO:
  - making directory: ZenPack.zenoss.PS.EMCXtremIO/ZenPack/zenoss/PS/EMCXtremIO
  - creating file: ZenPack.zenoss.PS.EMCXtremIO/setup.py
  - creating file: ZenPack.zenoss.PS.EMCXtremIO/MANIFEST.in
  - creating file: ZenPack.zenoss.PS.EMCXtremIO/ZenPacks/__init__.py
Traceback (most recent call last):
  File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.ZenPackLib-2.0.1.egg/ZenPacks/zenoss/ZenPackLib/zenpacklib.py", line 169, in <module>
    script.run()
  File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.ZenPackLib-2.0.1.egg/ZenPacks/zenoss/ZenPackLib/lib/libexec/ZPLCommand.py", line 187, in run
    self.create_zenpack_srcdir(self.options.zenpack)
  File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.ZenPackLib-2.0.1.egg/ZenPacks/zenoss/ZenPackLib/lib/libexec/ZPLCommand.py", line 287, in create_zenpack_srcdir
    with open(namespace_init_fname, 'w') as namespace_init_f:
IOError: [Errno 2] No such file or directory: 'ZenPack.zenoss.PS.EMCXtremIO/ZenPacks/__init__.py'

[zenoss@domain ~]$ zenpacklib --version
2.0.0dev
@vikt0rs
Copy link
Author

vikt0rs commented Feb 17, 2017

ok, the quick debug showed, that the error was in initial ZP name - ZenPack.zenoss.PS.EMCXtremIO not ZenPacks.zenoss.PS.EMCXtremIO. Should this be handled in some way?

@cluther
Copy link
Member

cluther commented Feb 17, 2017

@vikt0rs: Yes. Validating that the name starts with ZenPacks. sounds like a good idea. I had to look at the error for quite a while even after you explained what it was to realize it was a missing s.

@vikt0rs
Copy link
Author

vikt0rs commented Feb 17, 2017

@cluther ok, I'll prepare a PR to handle this situation, if nobody minds

vikt0rs added a commit that referenced this issue Feb 20, 2017
Added a check, that ZP name starts with "ZenPacks." to avoid typos and
errors like #415
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants