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

TypeError in find_item from find_empty_drive #54

Closed
glennmatthews opened this issue Nov 7, 2016 · 1 comment
Closed

TypeError in find_item from find_empty_drive #54

glennmatthews opened this issue Nov 7, 2016 · 1 comment
Assignees
Labels

Comments

@glennmatthews
Copy link
Owner

(venv)SCODONNE-M-N01F:CSROVF.v1 scodonne$ cot inject-config vz-csr1000v-w-config-nfv.ova -c ./iosxe-config.txt
    INFO: Loading 'vz-csr1000v-w-config-nfv.ova' as OVF
    INFO: OVF version is 1.x
    INFO: OVF product class com.cisco.csr1000v --> platform CSR1000V
Overwrite existing file vz-csr1000v-w-config-nfv.ova? [y]
Traceback (most recent call last):
  File "bin/cot", line 11, in <module>
    sys.exit(main())
  File "lib/python2.7/site-packages/COT/cli.py", line 644, in main
    CLI().run(sys.argv[1:])
  File "lib/python2.7/site-packages/COT/cli.py", line 326, in run
    return self.main(args)
  File "lib/python2.7/site-packages/COT/cli.py", line 607, in main
    args.instance.run()
  File "lib/python2.7/site-packages/COT/inject_config.py", line 140, in run
    drive_device = vm.find_empty_drive(platform.BOOTSTRAP_DISK_TYPE)
  File "lib/python2.7/site-packages/COT/ovf/ovf.py", line 2621, in find_empty_drive
    properties={self.HOST_RESOURCE: None})
  File "lib/python2.7/site-packages/COT/ovf/hardware.py", line 246, in find_item
    .format(resource_type, "\n".join(matches)))
TypeError: sequence item 0: expected string, OVFItem found
@glennmatthews glennmatthews self-assigned this Nov 7, 2016
@glennmatthews
Copy link
Owner Author

Multi-layered issue:

  1. find_item is trying to raise a LookupError due to finding multiple matches. However the error is not being constructed properly, resulting in the reported TypeError.
  2. find_empty_drive should probably be using find_all_items instead of find_item as it's OK if there are multiple valid drives - we can just pick the first one available.

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

No branches or pull requests

1 participant