Small tweak
This commit is contained in:
parent
afdc395379
commit
759dd28482
|
@ -5,7 +5,6 @@ import eventlet
|
|||
import six
|
||||
|
||||
from ironicclient import client, exceptions
|
||||
from keystoneclient.v2_0 import client as keystone
|
||||
|
||||
from ironic_discoverd import conf
|
||||
from ironic_discoverd import firewall
|
||||
|
@ -16,16 +15,11 @@ ALLOW_SEARCH_BY_MAC = True
|
|||
OS_ARGS = ('os_password', 'os_username', 'os_auth_url', 'os_tenant_name')
|
||||
|
||||
|
||||
def get_client():
|
||||
def get_client(): # pragma: no cover
|
||||
args = dict((k, conf.get('discoverd', k)) for k in OS_ARGS)
|
||||
return client.get_client(1, **args)
|
||||
|
||||
|
||||
def get_keystone(token):
|
||||
return keystone.Client(token=token, auth_url=conf.get('discoverd',
|
||||
'os_auth_url'))
|
||||
|
||||
|
||||
def is_valid_mac(address):
|
||||
m = "[0-9a-f]{2}(:[0-9a-f]{2}){5}$"
|
||||
return (isinstance(address, six.string_types)
|
||||
|
|
|
@ -7,6 +7,7 @@ import sys
|
|||
from flask import Flask, request
|
||||
|
||||
from keystoneclient import exceptions
|
||||
from keystoneclient.v2_0 import client as keystone
|
||||
|
||||
from ironic_discoverd import conf
|
||||
from ironic_discoverd import discoverd
|
||||
|
@ -17,6 +18,11 @@ app = Flask(__name__)
|
|||
LOG = discoverd.LOG
|
||||
|
||||
|
||||
def get_keystone(token): # pragma: no cover
|
||||
return keystone.Client(token=token, auth_url=conf.get('discoverd',
|
||||
'os_auth_url'))
|
||||
|
||||
|
||||
@app.route('/v1/continue', methods=['POST'])
|
||||
def post_continue():
|
||||
data = request.get_json(force=True)
|
||||
|
|
Loading…
Reference in New Issue