-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
0
-
False
-
-
False
-
?
-
rhos-storage-glance
-
None
-
-
-
-
Low
Problem Description
When `glance-manage db` is run without specifying a subcommand (such as `version`, `sync`, `expand`, `contract`, etc.), the command crashes with an unhandled `AttributeError` instead of displaying a helpful usage message.
The root cause is that the code attempts to access `CONF.command.action` without first checking if it is `None`. When no subcommand is provided, `CONF.command.action` is `None`, causing the `startswith()` method call to fail.
To Reproduce Steps to reproduce the behavior:
1. Execute `glance-manage db` without any subcommand:
```bash
$ glance-manage db
```
2. Observe the error output:
```
CRITICAL glance [-] Unhandled error: AttributeError: 'NoneType' object has no attribute 'startswith'
ERROR glance Traceback (most recent call last):
ERROR glance File "/usr/local/bin/glance-manage", line 10, in <module>
ERROR glance sys.exit(main())
ERROR glance File "/opt/stack/glance/glance/cmd/manage.py", line 558, in main
ERROR glance if CONF.command.action.startswith('db'):
ERROR glance AttributeError: 'NoneType' object has no attribute 'startswith'
Expected behavior
- When `glance-manage db` is executed without a subcommand, it should:
- Display a helpful message listing all available database subcommands
- Exit gracefully with an appropriate exit code (e.g., 2 for usage error)
- Not raise an unhandled exception
- account is impacted by
-
OSPRH-25759 Review Upstream patch
-
- Closed
-