Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow None state from charm_func_with_configs #270

Merged
merged 2 commits into from
Jan 30, 2019

Conversation

thedac
Copy link
Contributor

@thedac thedac commented Jan 29, 2019

The charm_func_with_configs function is passed to
_ows_check_charm_func in order to allow unique status checks per
charm. It works when the charm sets a state like blocked or
maintenance. However, when you want the custom
charm_func_with_configs to do nothing and allow the rest of the
assess status code to run unimpeded there is no state setting to do
this. If set to None the code currently Tracebacks. "active" will
work but the charm_func_with_configs may not have the full
perspective to confirm this is the case.

Allow the charm_func_with_configs to return None, None when no action
is required.

Example:

def charm_func_with_configs():
 """Unique status check"""
   if key != value:
       """Unique status result"""
       return "blocked", "This charm requires key to equal value"
   """The key does equal value so let the rest of asses status code
   determine the state as normal."""
   return None, None

The charm_func_with_configs function is passed to
_ows_check_charm_func in order to allow unique status checks per
charm. It works when the charm sets a state like blocked or
maintenance. However, when you want the custom
charm_func_with_configs to do nothing and allow the rest of the
assess status code to run unimpeded there is no state setting to do
this. If set to None the code currently Tracebacks. "active" will
work but the charm_func_with_configs may not have the full
perspective to confirm this is the case.

Allow the charm_func_with_configs to return None, None when no action
is required.

Example:

def charm_func_with_configs():
   # Unique status check
   if key != value:
       # Unique status result
       return "blocked", "This charm requires key to equal value"
   # The key does equal value so let the rest of asses status code
   # determine the state as normal.
   return None, None
Copy link
Contributor

@ajkavanagh ajkavanagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

@ajkavanagh ajkavanagh merged commit 036fed4 into juju:master Jan 30, 2019
openstack-gerrit pushed a commit to openstack/charm-ceilometer that referenced this pull request Jan 30, 2019
Currently it is unclear that ceilometer is not actually ready when it
is related to gnocchi until the ceilometer-upgrade action has run. The
status will show active Unit is ready when it is not.

When gnocchi is related, check that the ceilometer-upgrade action has
been run. If not set workload status to prompt the administator to run
the action.

Please merge the charm-helpers change first:
juju/charm-helpers#270

Partial-Bug: #1811108
Change-Id: Id778ed3f59e4bcde9c6586aad46be2b5b9ccb531
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Jan 30, 2019
* Update charm-ceilometer from branch 'master'
  - Merge "Status blocked until ceilometer-upgrade action"
  - Status blocked until ceilometer-upgrade action
    
    Currently it is unclear that ceilometer is not actually ready when it
    is related to gnocchi until the ceilometer-upgrade action has run. The
    status will show active Unit is ready when it is not.
    
    When gnocchi is related, check that the ceilometer-upgrade action has
    been run. If not set workload status to prompt the administator to run
    the action.
    
    Please merge the charm-helpers change first:
    juju/charm-helpers#270
    
    Partial-Bug: #1811108
    Change-Id: Id778ed3f59e4bcde9c6586aad46be2b5b9ccb531
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants