Use ironic_dicoverd.client
Change-Id: I6c7ef1e2797dbabab029d15a3797d7c580cdc7cc
This commit is contained in:
parent
5099cfc63c
commit
465e3c0e4e
@ -22,3 +22,4 @@ python-ceilometerclient>=1.0.6
|
||||
pytz>=2013.6
|
||||
|
||||
python-ironicclient>=0.2.1
|
||||
ironic-discoverd>=1.0.0
|
||||
|
@ -6,7 +6,7 @@ set -o errexit
|
||||
# Increment me any time the environment should be rebuilt.
|
||||
# This includes dependency changes, directory renames, etc.
|
||||
# Simple integer sequence: 1, 2, 3...
|
||||
environment_version=46
|
||||
environment_version=47
|
||||
#--------------------------------------------------------#
|
||||
|
||||
function usage {
|
||||
|
@ -10,18 +10,17 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import json
|
||||
import logging
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from horizon.utils import memoized
|
||||
from ironic_discoverd import client as discoverd_client
|
||||
from ironicclient import client as ironic_client
|
||||
from novaclient.v1_1.contrib import baremetal
|
||||
from openstack_dashboard.api import base
|
||||
from openstack_dashboard.api import glance
|
||||
from openstack_dashboard.api import nova
|
||||
import requests
|
||||
|
||||
from tuskar_ui.cached_property import cached_property # noqa
|
||||
from tuskar_ui.handle_errors import handle_errors # noqa
|
||||
@ -53,6 +52,7 @@ DELETING_STATE = 'deleting'
|
||||
FREE_STATE = 'free'
|
||||
|
||||
|
||||
IRONIC_DISCOVERD_URL = getattr(settings, 'IRONIC_DISCOVERD_URL', None)
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -231,12 +231,11 @@ class IronicNode(base.APIResourceWrapper):
|
||||
:param uuids: IDs of IronicNodes
|
||||
:type uuids: list of str
|
||||
"""
|
||||
url = getattr(settings, 'IRONIC_DISCOVERD_URL', None)
|
||||
if url:
|
||||
headers = {'content-type': 'application/json',
|
||||
'x-auth-token': request.user.token.id}
|
||||
requests.post(url + "/v1/discover",
|
||||
data=json.dumps(uuids), headers=headers)
|
||||
if not IRONIC_DISCOVERD_URL:
|
||||
return
|
||||
for uuid in uuids:
|
||||
discoverd_client.introspect(uuid, IRONIC_DISCOVERD_URL,
|
||||
request.user.token.id)
|
||||
|
||||
@classmethod
|
||||
def set_maintenance(cls, request, uuid, maintenance):
|
||||
|
@ -162,5 +162,5 @@ class RolesTest(test.BaseAdminViewTests):
|
||||
self.assertEqual(len(mock_patch.call_args_list), 1)
|
||||
args = mock_patch.call_args_list[0][0]
|
||||
self.assertEqual(args[1], plan.id)
|
||||
self.assertEqual(args[2]['Controller-1::Flavor'], u'flavor-1')
|
||||
self.assertEqual(args[2]['Controller-1::Image'], u'2')
|
||||
self.assertEqual(args[2]['Controller-1::Flavor'], u'flavor-1')
|
||||
self.assertEqual(args[2]['Controller-1::Image'], u'2')
|
||||
|
Loading…
x
Reference in New Issue
Block a user