Description of problem:
Calling service.atomic? or service.composite? will fail if a service does not an associated service_template.
Building a service via Automate can duplicate this case.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Build a service via Automate without an associated service_template
2. Call atomic? or composite? on said service
An exception will be raised - NoMethodError - undefined method atomic? | composite? for nil:NilClass
true or false returned
New commit detected on ManageIQ/manageiq/master:
Author: Drew Bomhof <firstname.lastname@example.org>
AuthorDate: Mon Feb 6 17:03:29 2017 -0500
Commit: Drew Bomhof <email@example.com>
CommitDate: Tue Feb 7 09:22:29 2017 -0500
Allow power_state for services that do not have an associated service_template
For the cases in Automate where a service does not have an associated ServiceTemplate
1. If children exist we have a composite service
2. If no children exists we have an atomic service
app/models/service.rb | 10 ++++++++--
spec/models/service_spec.rb | 10 ++++++++++
2 files changed, 18 insertions(+), 2 deletions(-)
Verified in 126.96.36.199. A service created without service template responds to atomic? and composite? with a boolean and not an error.