Miscellaneous code cleanup.

Change-Id: I6028247466378327f03b71dc2063dd2777b9382a
This commit is contained in:
Josh Kearney 2012-04-02 12:27:30 -05:00
parent 2db73cd5a1
commit f6014dd8c5
5 changed files with 21 additions and 10 deletions

View File

@ -20,7 +20,6 @@ Base utilities to build API operation managers and objects on top of.
"""
import contextlib
import errno
import hashlib
import os
from novaclient import exceptions
@ -113,7 +112,7 @@ class Manager(utils.HookableMixin):
try:
os.makedirs(cache_dir, 0755)
except OSError as e:
except OSError:
# NOTE(kiall): This is typicaly either permission denied while
# attempting to create the directory, or the directory
# already exists. Either way, don't fail.

View File

@ -98,7 +98,7 @@ class HTTPClient(httplib2.Http):
if body:
try:
body = json.loads(body)
except ValueError, e:
except ValueError:
pass
else:
body = None
@ -166,7 +166,7 @@ class HTTPClient(httplib2.Http):
service_name=self.service_name)
self.management_url = management_url.rstrip('/')
return None
except exceptions.AmbiguousEndpoints, exc:
except exceptions.AmbiguousEndpoints:
print "Found more than one valid endpoint. Use a more " \
"restrictive filter"
raise

View File

@ -1 +1,17 @@
# Copyright (c) 2012 OpenStack, LLC.
#
# All Rights Reserved.
#
# 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.
from novaclient.v1_1.client import Client

View File

@ -14,8 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import urllib
from novaclient import base

View File

@ -1134,12 +1134,10 @@ def do_dns_list(cs, args):
@utils.arg('ip', metavar='<ip>', help='ip address')
@utils.arg('name', metavar='<name>', help='DNS name')
@utils.arg('domain', metavar='<domain>', help='DNS domain')
@utils.arg('--type', metavar='<type>', help='dns type (e.g. "A")',
default='A')
@utils.arg('--type', metavar='<type>', help='dns type (e.g. "A")', default='A')
def do_dns_create(cs, args):
"""Create a DNS entry for domain, name and ip."""
entries = cs.dns_entries.create(args.domain, args.name,
args.ip, args.type)
cs.dns_entries.create(args.domain, args.name, args.ip, args.type)
@utils.arg('domain', metavar='<domain>', help='DNS domain')