Skip to content

python-common: don't assert when building rados url#36383

Merged
sebastian-philipp merged 1 commit intoceph:masterfrom
mgfritch:orch-nfs-rados-url
Aug 4, 2020
Merged

python-common: don't assert when building rados url#36383
sebastian-philipp merged 1 commit intoceph:masterfrom
mgfritch:orch-nfs-rados-url

Conversation

@mgfritch
Copy link
Contributor

breaks the orch ls --format yaml command

Signed-off-by: Michael Fritch mfritch@suse.com

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard backend
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

breaks the `orch ls --format yaml` command

Signed-off-by: Michael Fritch <mfritch@suse.com>
@mgfritch
Copy link
Contributor Author

2020-07-30T11:29:14.293-0600 7fd52ef64700  0 log_channel(audit) log [DBG] : from='client.6672 -' entity='client.admin' cmd=[{"prefix": "orch ls", "service_type": "nfs", "target": ["mon-mgr", ""], "format": "yaml"}]: dispatch
2020-07-30T11:29:14.293-0600 7fd52f765700  0 [cephadm ERROR orchestrator._interface] _Promise failed
Traceback (most recent call last):
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 299, in _finalize
    next_result = self._on_complete(self._value)
  File "/usr/share/ceph/mgr/cephadm/module.py", line 102, in <lambda>
    return CephadmCompletion(on_complete=lambda _: f(*args, **kwargs))
  File "/usr/share/ceph/mgr/cephadm/module.py", line 1522, in describe_service
    return self._describe_service(service_type=service_type,
  File "/usr/share/ceph/mgr/cephadm/module.py", line 1584, in _describe_service
    sm[n].rados_config_location = spec.rados_config_location()
  File "/usr/lib/python3.6/site-packages/ceph/deployment/service_spec.py", line 601, in rados_config_location
    assert self.pool
AssertionError
2020-07-30T11:29:14.293-0600 7fd52f765700 -1 log_channel(cephadm) log [ERR] : _Promise failed
Traceback (most recent call last):
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 299, in _finalize
    next_result = self._on_complete(self._value)
  File "/usr/share/ceph/mgr/cephadm/module.py", line 102, in <lambda>
    return CephadmCompletion(on_complete=lambda _: f(*args, **kwargs))
  File "/usr/share/ceph/mgr/cephadm/module.py", line 1522, in describe_service
    return self._describe_service(service_type=service_type,
  File "/usr/share/ceph/mgr/cephadm/module.py", line 1584, in _describe_service
    sm[n].rados_config_location = spec.rados_config_location()
  File "/usr/lib/python3.6/site-packages/ceph/deployment/service_spec.py", line 601, in rados_config_location
    assert self.pool
AssertionError
2020-07-30T11:29:14.293-0600 7fd52f765700 -1 mgr handle_command module 'orchestrator' command handler threw exception:
2020-07-30T11:29:14.293-0600 7fd52f765700 -1 mgr.server reply reply (22) Invalid argument Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1171, in _handle_command
    return self.handle_command(inbuf, cmd)
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 138, in handle_command
    return dispatch[cmd['prefix']].call(self, cmd, inbuf)
  File "/usr/share/ceph/mgr/mgr_module.py", line 311, in call
    return self.func(mgr, **kwargs)
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 100, in <lambda>
    wrapper_copy = lambda *l_args, **l_kwargs: wrapper(*l_args, **l_kwargs)
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 89, in wrapper
    return func(*args, **kwargs)
  File "/usr/share/ceph/mgr/orchestrator/module.py", line 446, in _list_services
    raise_if_exception(completion)
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 658, in raise_if_exception
    raise e
AssertionError

@sebastian-philipp
Copy link
Contributor

just for my understanding, when exactly can pool be empty?

@mgfritch
Copy link
Contributor Author

just for my understanding, when exactly can pool be empty?

it shouldn't happen as long as we've properly validated a spec before use. see related #36393

@mgfritch
Copy link
Contributor Author

jenkins test make check

@Devp00l
Copy link

Devp00l commented Aug 3, 2020

Title:

python-common: don't assert when building rados url

Description:

breaks the orch ls --format yaml command

What changed:
Removed assert of self.pool and replaced it with an if-clause so that an empty pool would not cause the function rados_config_location (in src/python-common/ceph/deployment/service_spec.py) to fail

The answer to @sebastian-philipp question is also not that meaningful (at least for myself) as it does not explain when the pool will be empty and rados is active.

I would suggest to update your commit message and PR description.
IMO the title should include generate or gathering as building sounds like the error occurred during a build.
The description should include the reason you did this fix / change or a tracker issue link that explains it.

@sebastian-philipp sebastian-philipp added the wip-swagner-testing My Teuthology tests label Aug 4, 2020
@sebastian-philipp
Copy link
Contributor

@sebastian-philipp sebastian-philipp merged commit 5846ca6 into ceph:master Aug 4, 2020
@mgfritch mgfritch deleted the orch-nfs-rados-url branch August 19, 2020 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants