switch SplitResult to use six
SplitResult included in six 1.6, switch to use six. Change-Id: I5a61c0ab74899fcbfc2405488bfce5bd1de96dd0
This commit is contained in:
parent
e12de4dba6
commit
21774ae8cb
@ -15,15 +15,9 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
"""Rest alarm notifier with trusted authentication."""
|
"""Rest alarm notifier with trusted authentication."""
|
||||||
|
|
||||||
try:
|
|
||||||
import urllib.parse
|
|
||||||
SplitResult = urllib.parse.SplitResult
|
|
||||||
except ImportError:
|
|
||||||
import urlparse
|
|
||||||
SplitResult = urlparse.SplitResult
|
|
||||||
|
|
||||||
from keystoneclient.v3 import client as keystone_client
|
from keystoneclient.v3 import client as keystone_client
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from ceilometer.alarm import notifier
|
from ceilometer.alarm import notifier
|
||||||
|
|
||||||
@ -58,8 +52,8 @@ class TrustRestAlarmNotifier(notifier.rest.RestAlarmNotifier):
|
|||||||
# Remove the trust prefix
|
# Remove the trust prefix
|
||||||
scheme = action.scheme[6:]
|
scheme = action.scheme[6:]
|
||||||
|
|
||||||
action = SplitResult(scheme, netloc, action.path, action.query,
|
action = parse.SplitResult(scheme, netloc, action.path, action.query,
|
||||||
action.fragment)
|
action.fragment)
|
||||||
|
|
||||||
headers = {'X-Auth-Token': client.auth_token}
|
headers = {'X-Auth-Token': client.auth_token}
|
||||||
notifier.rest.RestAlarmNotifier.notify(
|
notifier.rest.RestAlarmNotifier.notify(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user