Revert "Scale out overcloud"

This reverts commit 435aedd417.

Due to error ($ openstack --help): Could not load EntryPoint.parse('baremetal_configure_boot = rdomanager_oscplugin.v1.baremetal:ConfigureBootPlugin')
ERROR: openstack 'ArgumentParser' object has no attribute 'debug'

Change-Id: I350f7ba3ed0737d6b407e82d5d89be444699119f
This commit is contained in:
Marek Aufart 2015-04-27 16:09:36 +01:00
parent 435aedd417
commit 72e760de83
7 changed files with 0 additions and 159 deletions

View File

@ -19,7 +19,6 @@ import logging
from ironicclient import client as ironic_client
from openstackclient.common import utils
from tuskarclient import client as tuskar_client
LOG = logging.getLogger(__name__)
@ -67,7 +66,6 @@ class ClientWrapper(object):
self._instance = instance
self._baremetal = None
self._orchestration = None
self._management = None
def baremetal(self):
"""Returns an baremetal service client"""
@ -127,18 +125,3 @@ class ClientWrapper(object):
self._orchestration = client
return self._orchestration
def management(self):
"""Returns an management service client"""
endpoint = self._instance.get_endpoint_for_service_type(
"management",
region_name=self._instance._region_name,
)
token = self._instance.auth.get_token(self._instance.session)
self._management = tuskar_client.get_client(
2, os_auth_token=token, tuskar_url=endpoint)
return self._management

View File

@ -1,48 +0,0 @@
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from openstackclient.tests import utils
class FakeClientWrapper(object):
def __init__(self):
self._instance = mock.Mock()
self._orchestration = None
self._management = None
def orchestration(self):
if self._orchestration is None:
self._orchestration = mock.Mock()
return self._orchestration
def management(self):
if self._management is None:
self._management = mock.Mock()
return self._management
class TestOvercloudScale(utils.TestCommand):
def setUp(self):
super(TestOvercloudScale, self).setUp()
self.app.client_manager.auth_ref = mock.Mock(auth_token="TOKEN")
self.app.client_manager.rdomanager_oscplugin = FakeClientWrapper()

View File

@ -1,40 +0,0 @@
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import mock
from rdomanager_oscplugin.tests.v1.overcloud_scale import fakes
from rdomanager_oscplugin.v1 import overcloud_scale
class TestOvercloudScale(fakes.TestOvercloudScale):
def setUp(self):
super(TestOvercloudScale, self).setUp()
# Get the command object to test
self.cmd = overcloud_scale.ScaleOvercloud(self.app, None)
@mock.patch('tripleo_common.scale.ScaleManager')
def test_scale_out(self, scale_manager):
argslist = ['-r', 'Compute-1', '-n', '2', 'overcloud', 'overcloud']
verifylist = [
('role', 'Compute-1'),
('num', '2')
]
parsed_args = self.check_parser(self.cmd, argslist, verifylist)
self.cmd.take_action(parsed_args)
scale_manager.scaleup(parsed_args.role, parsed_args.num)
scale_manager.scaleup.called_once_with('Compute-1', '2')

View File

@ -1,51 +0,0 @@
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import logging
from cliff import command
from tripleo_common import scale
class ScaleOvercloud(command.Command):
"""Scale Overcloud nodes
Update role's count in tuskar overcloud plan and
trigger overcloud stack-update. Tuskar role is specified
with version, e.g.:
openstack overcloud scale stack overcloud overcloud -r Compute-1 -n 2
"""
log = logging.getLogger(__name__ + ".ScaleOvercloud")
def get_parser(self, prog_name):
parser = super(ScaleOvercloud, self).get_parser(prog_name)
parser.add_argument('-r', '--role', dest='role', required=True)
parser.add_argument('-n', '--num', dest='num', required=True)
parser.add_argument('plan', help="Name or ID of tuskar plan to scale")
parser.add_argument('stack', help="Name or ID of heat stack to scale")
return parser
def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args)
management = self.app.client_manager.rdomanager_oscplugin.management()
orchestration = (self.app.client_manager.rdomanager_oscplugin.
orchestration())
scale_manager = scale.ScaleManager(
tuskarclient=management,
heatclient=orchestration,
plan_id=parsed_args.plan,
stack_id=parsed_args.stack)
scale_manager.scaleup(parsed_args.role, parsed_args.num)

View File

@ -14,5 +14,3 @@ six>=1.9.0
# The ironic-discoverd OSC integration isn't yet on PyPI
-e git://github.com/stackforge/ironic-discoverd.git#egg=ironic_discoverd
# tripleo-common lib is not yet on PyPi
-e git://github.com/rdo-management/tripleo-common.git#egg=tripleo_common

View File

@ -61,5 +61,4 @@ openstack.rdomanager_oscplugin.v1 =
overcloud_deploy = rdomanager_oscplugin.v1.overcloud_deploy:DeployPlugin
overcloud_image_build = rdomanager_oscplugin.v1.overcloud_image:BuildPlugin
overcloud_image_create = rdomanager_oscplugin.v1.overcloud_image:CreatePlugin
overcloud_scale_stack = rdomanager_oscplugin.v1.overcloud_scale:ScaleOvercloud
undercloud_install = rdomanager_oscplugin.v1.undercloud:InstallPlugin