parser.Stack add use_stored_context option

Add an option to switch to a context based on the user_creds data
at constructor time, which allows a cleaner interface for selecting
the stored context than creating it before creating the Stack object.

Partial-Bug: #1306294

Change-Id: I44df4e142dfbba1e70199b0d8f14c910f028a0f1
Convert service.py to use_stored_context

Related-Bug: #1306294

Change-Id: Ia75126ad77e6cad187a1953c2fb43eceb50299f2
Remove test_autoscaling _stub_validate

The _stub_validate is stubbing the wrong thing, it stubs the top-level
validate which hides the fact that the image validation fails for all
delete operations, where the validation always fails because the call
to glance is not correctly stubbed.

Partial-Bug: #1306294

Change-Id: Ibe3480f5ff358c00a4ad3c2df9b6cd7d15bda71d
test_autoscaling refactor suspend/resume stubbing

Rework to encapsulate the suspend/resume stubbing in functions and add a
stub of the image validation, which is required because the properties
get revalidated when we create the events associated with the state
transition (ref bug #1324102).

With the current keystoneclient mocking this is not visible in the
tests because the error creating the client to do the validation is
obscured by the fact that the Event constructor tolerates a validation
error and the error creating the client is just treated as an unexpected
validation error by the CustomConstraint code.

Moving to a model where clients.keystone() is consistently mocked
exposes the fact that we will try to connect to glance on suspend when
the event is created if the validation is not correctly stubbed.

Partial-Bug: #1306294

Change-Id: I001d3a432397d4cdfaa62145228aad7eaf051b98
Merge "parser.Stack add use_stored_context option"
Merge "Convert service.py to use_stored_context"
Merge "Remove test_autoscaling _stub_validate"
Merge "test_autoscaling refactor suspend/resume stubbing"