Reverse-specification of python-manilaclient — branch stable/2026.2
Branch
stable/2026.2@d18a7e966(6.3.0+ 2 maintenance commits) — repository https://opendev.org/openstack/python-manilaclient — analysed on 2026-11-01
- Scope: the whole repository, focused on the OSC commands and the Python API they call. The change history (step 7) was not requested.
- Dependencies read at fixed versions: osc-lib 4.7.0, cliff 4.16.0, keystoneauth1 5.17.0 and openstacksdk 4.20.0, cited with the prefixes
osc-lib:,cliff:,keystoneauth:. python-openstackclient at8bb083b83(openstackclient:), and Manila at4fbc4b4f3(manila:), read only. - References are
file:linefrom the repository root. [inferred] marks a statement not followed to the end. [observed] marks a behaviour seen by running the realopenstackshell against a local stub on 127.0.0.1. - The stub is not a service. Observed behaviour says what the client sends and how it reacts to a given answer. It says nothing about what a real Manila does. No lab, cluster or cloud was contacted.
Files of this specification
| File | Content |
|---|---|
| 01-cli-commands_stable-2026.2.md | shared mechanics, functional description per family, the 154 commands, relation with openstackclient.share.v2 |
| 02-errors_stable-2026.2.md | exit codes, how failures reach the user, 19 defects, required response fields, 176 error messages |
| 03-interactions_stable-2026.2.md | client stack, Keystone, catalog, microversion negotiation, headers, REST conventions, name lookups, Neutron |
| 04-scenarios_stable-2026.2.md | 6 scenarios with sequence diagrams and diagnostics |
| 05-async-processing_stable-2026.2.md | no background processing; client-side polling with --wait |
| 07-rewrite-pack_stable-2026.2.md | client contract: requirements on the service, data files, proof and limits |
| _verification_stable-2026.2.md | output of the reference checker |
File 06 (change history) is absent because it was not requested.
Overview
python-manilaclient is the plugin that gives the openstack CLI its share commands, and a Python library for Manila, the Shared File System service. Each command:
- resolves its arguments, often by listing a collection to turn a name into an ID;
- checks the microversion locally;
- calls a manager of
manilaclient.v2, which picks a variant of the method for the microversion and sends REST calls through keystoneauth; - prints the result through cliff.
It has no database, message bus, server or background process. The legacy manila command was removed in January 2026 (commit e448fc8), so openstack is the only way in.
Architecture
flowchart LR user[User or script] -->|argv, env| osc[openstack process] cfg[clouds.yaml, OS_* variables] --> osc osc -->|entry points| plugin[manilaclient.osc.plugin] plugin --> cmds[manilaclient/osc/v2: 154 commands] cmds --> mgr[manilaclient/v2: 32 managers] mgr --> sc[SessionClient] sc --> ksa[keystoneauth1] cmds -->|project and user lookups| ksc[python-keystoneclient] ksc --> ksa cmds -->|Neutron names, two commands| sdk[openstacksdk] sdk --> ksa ksa -->|HTTPS, X-Auth-Token| ks[Keystone] ksa -->|HTTPS, X-OpenStack-Manila-API-Version| m[Manila] ksa -->|HTTPS| n[Neutron] py[Python programs] -.->|library| mgr
Processes
| Process | Entry point | Role | Listens to / consumes |
|---|---|---|---|
openstack (python-openstackclient) | openstack.cli.extension share (pyproject.toml:36-37), group openstack.share.v2 (pyproject.toml:39) | runs one command per process | argv, environment; listens on nothing |
There is no separate legacy shell: no console_scripts in pyproject.toml, and manilaclient/shell.py no longer exists.
External dependencies
| System | Protocol | Library | Configuration | Usage |
|---|---|---|---|---|
| Keystone | HTTPS REST | keystoneauth1, python-keystoneclient | --os-auth-url, clouds.yaml | token, catalog, project and user lookups |
| Manila | HTTPS REST, microversions | manilaclient.v2 on keystoneauth1 | catalog, or --os-endpoint-override | all commands |
| Neutron | HTTPS REST | openstacksdk | catalog | share network create, share network subnet create with Neutron options |
| Local disk | files | open() | manilaclient_UUID_CACHE_DIR, MANILACLIENT_UUID_CACHE_DIR, default ~/.cache/manilaclient | empty completion files (manilaclient/base.py:129-164) |
Key figures
| Item | Count |
|---|---|
| Commands | 154 in one group: 75 with no output, 48 single, 31 lists; 603 arguments, 175 of them required |
| Manager methods, with microversion variants | 187 methods, 288 variants |
| Operations in the API surface | 232: 177 observed on the wire, 55 static |
| Microversions | client 2.0 to 2.98; 86 gate sites in the commands, on 43 microversions |
| Exception classes defined | 49; 176 distinct messages at 199 sites in the commands |
| Unit tests | 1,433 pass, of which 573 are OSC tests giving 573 vectors, identical in two runs |
| Commands sending at least one request to the stub | 154 of 154 |
| Defects reproduced | 19, listed in 02 § 4 |
Points of attention
- **
share setalways sendsreset_task_statewithnull[observed]** (manilaclient/osc/v2/share.py:958).share server set --statusdoes the same (manilaclient/osc/v2/share_servers.py:530). On a real Manila this action is admin-only, so a member's rename should succeed and exit 1, and an admin's should clear the task state [inferred frommanila:manila/policies/shares.py:564]. - **
share server migration start --check-onlycan start a real migration [observed]**, when the check answers an empty body (manilaclient/osc/v2/share_servers.py:740-757). - Crashes below the version they assume [observed]:
share snapshot createbelow 2.73,share network setbelow 2.63,share network subnet createbelow 2.78,share server adoptat 2.49 and 2.50. These matter when a server is older than the client, since the client lowers its version silently. - Options that cannot work [observed]:
share adopt --publicandshare quota set --class --encryption-keysraiseTypeError. - **
share access list --propertiesdrops the other filters [observed]** (manilaclient/osc/v2/share_access_rules.py:351). - **
share restore <name>sends the name in the URL [observed]**, despite its help text (manilaclient/osc/v2/share.py:1818). - Exit 0 on failures [observed]:
share create --waiton an error status,share backup unseton a failed update. **--waithas no time limit on status waits.** - **
OS_SHARE_API_VERSION=2breaks every share command [observed]** (manilaclient/api_versions.py:54), and--os-share-api-versionstops at 2.98 while Manila announces 2.99. - A name lookup lists the whole collection, four times for shares from 2.69 [observed] (
manilaclient/base.py:253-279). A service that ignoresis_soft_deletedbreaks it. - Dict filters travel as a Python repr in the query string [observed] (
manilaclient/base.py:229). - Hard requirements on answers: collection and resource keys,
size,is_public,required_extra_specs,backend_details, and a non-empty JSON error body. Without them, a bare Python message is printed [observed]. See 02 § 5. - Unit tests cannot catch these: they use mocks (
manilaclient/tests/unit/osc/v2/fakes.py:27).share restorehas no test. - Secrets:
--passwordof security services is visible in the process list, andshare transfer createprints theauth_key(manilaclient/osc/v2/security_services.py:118,manilaclient/osc/v2/share_transfers.py:73). - **
openstackclient.share.v2does not interfere**: it is ignored by OSC, it holds 40 of the 154 names, and it differs in negotiation and in a few options. See 01 § 4.
Blind spots / [inferred]
- No service was contacted. Real Manila behaviour is read in its code at most, and marked [inferred]. Status transitions in the diagram of 01 are [inferred]. Whether a real Manila returns what the client needs in every microversion was not tested.
- Functional tests (
manilaclient/tests/functional/osc, 24 files) need a cloud and were not run. - The shaped stub answers one body for everything, with every key. It hides field-level mismatches between the client and a real service, and exit 0 there only means the client accepted that body.
- Synthetic arguments follow one path per command. Options are covered only by the all-options run at 2.98, and by the targeted cases. The version sweep uses minimal arguments, so a gate behind an option is not exercised by it.
- **
--waitloops** were run in only a few cases, as polling takes time. - OpenKeel's Manila was neither read nor run.
- **
manilaclient/v1**,HTTPClientand theClient(input_auth_token=…)path are outside the commands, and were read only briefly. Library use by other programs (for examplemanila-ui) was not surveyed. - Keystone and Neutron paths go through keystoneclient and the SDK, and only their first requests were seen.
- Output formatting was not specified command by command, beyond what 01 says; the catalogue and
stdoutsamples inwire-probe-shapedgive the columns. - Python 3.13 on macOS only.
Source: reverse-spec-python-manilaclient/00-summary_stable-2026.2.md. The _rewrite/ and _inventory/ files are not published on the site.