[APIv2] remove a method that places in wrong file

"construct_ngs_for_scaling" has no relation to "plugin", and
it already existes in "clusters.py".
There are also some trivial fixes.

Change-Id: I51bef93fdb66c44726cc0c7f67e478c4f29dd342
This commit is contained in:
Shu Yingya 2017-01-24 08:14:10 +00:00
parent 6463f5bc59
commit 9f5f87d282
2 changed files with 2 additions and 18 deletions

View File

@ -73,7 +73,7 @@ class AuthValidatorV2(base.Middleware):
Handle incoming requests by checking tenant info from the
headers and url ({tenant_id} url attribute), if using v1 or v1.1
APIs. If using the v2 API, this function will check the token
tenant and the requested tenent in the headers.
tenant and the requested tenant in the headers.
Pass request downstream on success.
Reject request if tenant_id from headers is not equal to the
@ -91,7 +91,6 @@ class AuthValidatorV2(base.Middleware):
version, rest = strutils.split_path(path, 2, 2, True)
requested_tenant = req.headers.get('OpenStack-Project-ID')
else:
version, requested_tenant, rest = strutils.split_path(
path, 3, 3, True)
except ValueError:

View File

@ -13,16 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from sahara import conductor as c
from sahara import context
from sahara.plugins import base as plugin_base
conductor = c.API
# Plugins ops
def get_plugins():
return plugin_base.PLUGINS.get_plugins(serialized=True)
@ -33,14 +29,3 @@ def get_plugin(plugin_name, version=None):
def update_plugin(plugin_name, values):
return plugin_base.PLUGINS.update_plugin(plugin_name, values)
def construct_ngs_for_scaling(cluster, additional_node_groups):
ctx = context.ctx()
additional = {}
for ng in additional_node_groups:
count = ng['count']
ng['count'] = 0
ng_id = conductor.node_group_add(ctx, cluster, ng)
additional.update({ng_id: count})
return additional