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

cot edit-properties CLI rejects property value strings containing '=' #59

Closed
ghost opened this issue Jan 12, 2017 · 3 comments
Closed
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Jan 12, 2017

I have automation that adds ssh private keys as properties on the ovf using cot 1.4.1. After updating to 1.7.4 this is not working. Playing around with the quotes didn't help either. Environment is bash on centos 6.

Eg.

cot edit-properties test.ovf -p 'autopubkey=ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuFzQ8Rd5k1USyoV50oOCsq5CiIxUrtPSeqiBpAAtrerfZrAbl1hOE8G3NSB97UolKzjAYVYSwaavXUomQhCAmjTa8wXszgl/p3Kf/tHyNYwxUUxUXQdAaiZSYd5f4UxdL71r2CSWHMhJq+t0giw6VF8+fuXxiDL+Bf5EPFwz7ZT0a1WLYOoK8eTve/YFL6jymOHzIvjW6+rzrhke/hCMVKQY/d7D7916x19N66AadJ0VQQmUmDXVUbUEGGdzgCwYF4Tq4oFKVgwQxl2dMkbnVisdSBbvN5bQP4oA10sTAVUj2mpN4HfsqZksDAHEL1NThKpOj8DSZlrA+PL4AJQTuw== root@MASTER-CentOS-6-Build-20170112140530100048' -o test.ova

 INFO: test.ovf' as OVF
    INFO: OVF version is 1.x
    INFO: OVF product class None --> platform GenericPlatform
usage: 
  cot edit-properties --help
  cot <opts> edit-properties PACKAGE [-p KEY1=VALUE1 [-p KEY2=VALUE2 ...]] [-l LABEL1 [-l LABEL2 ...]] [-d DESC1 [-d DESC2 ...]] [-c CONFIG_FILE] [-u [USER_CONFIGURABLE]] [-t TRANSPORT [TRANSPORT2 ...]] [-o OUTPUT]
  cot <opts> edit-properties PACKAGE [-u [USER_CONFIGURABLE]] [-o OUTPUT]
cot edit-properties: error: Invalid property 'autopubkey=ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuFzQ8Rd5k1USyoV50oOCsq5CiIxUrtPSeqiBpAAtrerfZrAbl1hOE8G3NSB97UolKzjAYVYSwaavXUomQhCAmjTa8wXszgl/p3Kf/tHyNYwxUUxUXQdAaiZSYd5f4UxdL71r2CSWHMhJq+t0giw6VF8+fuXxiDL+Bf5EPFwz7ZT0a1WLYOoK8eTve/YFL6jymOHzIvjW6+rzrhke/hCMVKQY/d7D7916x19N66AadJ0VQQmUmDXVUbUEGGdzgCwYF4Tq4oFKVgwQxl2dMkbnVisdSBbvN5bQP4oA10sTAVUj2mpN4HfsqZksDAHEL1NThKpOj8DSZlrA+PL4AJQTuw== root@MASTER-CentOS-6-Build-20170112140530100048' - properties must be in 'key[=value][+type]' form

@glennmatthews glennmatthews self-assigned this Jan 17, 2017
@glennmatthews
Copy link
Owner

Thanks for the report. Looking into this. If it's a regression it is most likely due to #50.

@glennmatthews
Copy link
Owner

Looks like the issue is the == in the SSH key, causing the regexp match ^([^=+]+?)(=[^=+]*?)?(\+[^=+]*?)?$ to fail. My fault for enforcing that we have exactly one '=' in the entire string rather than being more flexible. Will work on a fix.

@glennmatthews glennmatthews changed the title Possible edit-properties regression cot edit-properties CLI rejects property value strings containing '=' Jan 17, 2017
@ghost
Copy link
Author

ghost commented Jan 17, 2017

danke!

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