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

Teardowndebug #26

Merged
merged 38 commits into from
May 5, 2017
Merged

Teardowndebug #26

merged 38 commits into from
May 5, 2017

Conversation

jimbr70
Copy link

@jimbr70 jimbr70 commented May 4, 2017

Various fixes, runs in 8.0....


This change is Reviewable

… as the model and if none found, uses the self.details.ResourceModelName.
… as the model and if none found, uses the self.details.ResourceModelName.

fixes
•	attribute_exist
•	get_attribute
•	set_attribute_value
to handle being passed in an attribute name or the ending string of an attribute name which is preceeded by a period and a model in the case of a 2nd gen shell.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 16.042% when pulling c81fda8 on teardowndebug into 7e16ec2 on develop.

else:
self.model = self.details.ResourceModelName

self.model = self.get_attrib_value_ending_in_model()
Copy link
Member

Choose a reason for hiding this comment

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

you can use the previous logic now that you fixed the attribute_exist function

return True
return False

# -----------------------------------------
# -----------------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

this function is not needed anymore

@@ -20,9 +24,10 @@ def __init__(self, reservation_id, logger):
""":type : logging.Logger"""
self.api_session = helpers.get_api_session()
self.id = reservation_id

self.owner = helpers.get_reservation_context_details().owner_user
Copy link
Member

Choose a reason for hiding this comment

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

the get_reservation_context_details result should be saved into a variable and then from there, you can take the owner and environment instead of calling this function twice.

Copy link
Member

Choose a reason for hiding this comment

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

also, now that we have the environmentPath, i would save it as well (self.environmentPath =..)

"""
Report on an error to the log file, output window is optional.There is also an option to raise the error up
:param str error_message: The error message you would like to present
:param str log_message: The error message you would like to write to the log. Keep None to use the message param
:param bool raise_error: Do you want to throw an exception
:param bool write_to_output_window: Would you like to write the message to the output window
"""

emailresult = ''
if raise_error:
Copy link
Member

Choose a reason for hiding this comment

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

these 2 ifs can be one

@@ -88,6 +115,51 @@ def report_info(self, message, log_message=None, write_to_output_window=False):
self._write_message_to_output(message, SEVERITY_INFO)

# ----------------------------------
def emailalert(self, subject, body, owner, ishtml=False, emailOwner=False):
Copy link
Member

Choose a reason for hiding this comment

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

change it to private (_email_alert)

Copy link
Member

@kalsky kalsky left a comment

Choose a reason for hiding this comment

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

please review and fix based on the comments

@jimbr70
Copy link
Author

jimbr70 commented May 5, 2017

sandbox_scripts/QualiEnvironmentUtils/Resource.py, line 25 at r1 (raw file):

Previously, kalsky wrote…

you can use the previous logic now that you fixed the attribute_exist function

I don't think so. The code defaults to the resource Model if there is no attribute, so we should leave the current code.


Comments from Reviewable

@jimbr70
Copy link
Author

jimbr70 commented May 5, 2017

sandbox_scripts/QualiEnvironmentUtils/Resource.py, line 49 at r1 (raw file):

Previously, kalsky wrote…

this function is not needed anymore

Hmmm. This will return the resource Model if there is no attribute for it, so I think this is needed.


Comments from Reviewable

jimbr70 and others added 7 commits May 5, 2017 08:39
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 15.686% when pulling 1000180 on teardowndebug into 7e16ec2 on develop.

kalsky added 2 commits May 5, 2017 11:50
move cloudshell required packages to the test_requirements
move the cloudshell packages requirements to test_requirements
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 15.686% when pulling 3194c5a on teardowndebug into 7e16ec2 on develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 15.686% when pulling 3194c5a on teardowndebug into 7e16ec2 on develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 15.983% when pulling b471401 on teardowndebug into 7e16ec2 on develop.

@kalsky kalsky merged commit 381c113 into develop May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants