Skip to content

chi.lease.create_lease does not document error behavior #42

Description

@robertu94

Hi, thanks again for the chi library. It simplifies things alot relative to the raw underlying openstack python commands I used a few years ago, but one issue I hit was chi.lease.create_lease does not document what happens when the requested resources are exhausted. Trying this function in an error condition, it returns None and prints a log message. While this is a decent C error reporting mechanism; and I do appreciate the improved error message relative the blazarclient message that is caught below, it is kind of an unexpected way to indicate an error in Python where exceptions are generally preferred (c.f. "Errors should never pass silently" - The Zen of Python). Perhaps instead of logging and returning None, you could perhaps instead use

raise RuntimeError(what_you_log_right_now) from blazar_exception

If you don't want to do this, please at least document the error handling for this routine.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions