-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
✅ certificate_install_bug_report.md
# certificate install --file fails with TypeError due to parameter mismatch
## Summary
When running the CLI command:
```bash
vmanage --host <host> --username <user> --password <pw> certificate install --file ./VSMART.cerThe following error occurs:
TypeError: install() got an unexpected keyword argument 'file'
Cause
In vmanage/cli/certificate/install.py, the function definition uses cert instead of file:
def install(ctx, file):
...
vmanage_certificate.install_device_cert(cert) # ← this should be 'file'Fix
Change cert to file:
vmanage_certificate.install_device_cert(file)Additionally, to avoid a 400 Bad Request error from vManage when uploading the certificate, the CLI must read the file content rather than passing the file path string:
with open(file, 'r') as f:
cert_content = f.read()
vmanage_certificate = Certificate(ctx.auth, ctx.host, ctx.port)
click.echo("Installing certificate...")
vmanage_certificate.install_device_cert(cert_content)Metadata
Metadata
Assignees
Labels
No labels