This patch aimed to reduce db call count when we invode k8sAPI.
For those user using bay name to do pod/rc/service operations, we
can saving a db call.
In k8s_conductor, lots of code will use bay_ident to get bay_uuid, kinds of
duplicated code, use retrieve_bay_uuid in conductor_utils to replace them.
retrieve_bay_uuid will return bay's uuid from bay_ident
Currently objects (pod/rc/service) are read from the
database. In order for native clients to work, they
must be read from the ReST bay endpoint. To execute
native clients, we must have one truth of the state
of the system, not two as we do now. This patch adds
changes for Replication Controller.
Also, please refer to the related-bug as to the temporary changes
done to make the test work for other objects namely pod,
service. These changes will be removed when the object from bay
patches for all the k8s objects are merged as part of a seperate
Partially-Implements: bp objects-from-bay
This allows common implementations to be reused later. Below is
the list of methods that were moved and renamed:
* handlers.k8s_conductor._retrieve_bay -> utils.retrieve_bay
* handlers.bay_conductor._get_baymodel -> utils.retrieve_bay
* handlers.k8s_conductor._retrieve_baymodel -> utils.retrieve_baymodel
* handlers.k8s_conductor._object_has_stack -> utils.object_has_stack
* handlers.k8s_conductor._retrieve_k8s_master_url ->
* handlers.k8s_conductor.Handler.k8s_api -> k8s_api.create_k8s_api
Partially-Implements: blueprint magnum-smart-bay-scale-down