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

Improve error message when helper package managers are not available #57

Closed
glennmatthews opened this issue Nov 10, 2016 · 1 comment
Closed
Assignees

Comments

@glennmatthews
Copy link
Owner

$ cot inject-config csr1000v-universalk9.16.03.01a-w-ios-config.ova -o csr1000v-universalk9.16.03.01a-w-1Int-BaseConfig-ios-config.ova -c csr1000v-Config.txt
    INFO: Loading 'csr1000v-universalk9.16.03.01a-w-ios-config.ova' as OVF
    INFO: OVF version is 1.x
    INFO: OVF product class com.cisco.csr1000v --> platform CSR1000V
No helper available or installable!

This is failing because none of the ISO helpers (mkisofs/genisoimage/xorriso) are available and the user is on a Mac that does not have MacPorts installed - but the error message fails to make that clear, and should be improved.

@glennmatthews
Copy link
Owner Author

glennmatthews commented Jan 18, 2017

Improved messages:

>>> helper_select(['mkisofs', 'genisoimage', 'xorriso'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "COT/helpers/helper.py", line 655, in helper_select
    raise HelperNotFoundError(msg)
COT.helpers.helper.HelperNotFoundError: No helper in list ['mkisofs', 'genisoimage', 'xorriso'] is available or installable!
Unsure how to install mkisofs.
COT can use MacPorts (https://www.macports.org/), if available on your system, to install mkisofs and other helpers for you.
Unsure how to install genisoimage.
Unsure how to install xorriso.
>>> helper_select([('qemu-img', '2.0.0'), 'vmdktool'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "COT/helpers/helper.py", line 655, in helper_select
    raise HelperNotFoundError(msg)
COT.helpers.helper.HelperNotFoundError: No helper in list [('qemu-img', '2.0.0'), 'vmdktool'] is available or installable!
Unsure how to install qemu-img.
Refer to http://www.qemu.org for information
COT can use MacPorts (https://www.macports.org/), if available on your system, to install qemu-img and other helpers for you.
Unsure how to install vmdktool.
Refer to http://www.freshports.org/sysutils/vmdktool/ for information
>>>
>>> import sys
>>> sys.platform = 'linux2'
>>> helper_select(['mkisofs', 'genisoimage', 'xorriso'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "COT/helpers/helper.py", line 655, in helper_select
    raise HelperNotFoundError(msg)
COT.helpers.helper.HelperNotFoundError: No helper in list ['mkisofs', 'genisoimage', 'xorriso'] is available or installable!
Unsure how to install mkisofs.
Unsure how to install genisoimage.
COT can use package managers 'yum' or 'apt-get' to install helpers on your system, but it appears that you have neither of these package managers?
Unsure how to install xorriso.
COT can use package managers 'yum' or 'apt-get' to install helpers on your system, but it appears that you have neither of these package managers?
>>> sys.platform = 'windows'
>>> helper_select(['mkisofs', 'genisoimage', 'xorriso'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "COT/helpers/helper.py", line 655, in helper_select
    raise HelperNotFoundError(msg)
COT.helpers.helper.HelperNotFoundError: No helper in list ['mkisofs', 'genisoimage', 'xorriso'] is available or installable!
Unsure how to install mkisofs.
Unsure how to install genisoimage.
Unsure how to install xorriso.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant