Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Removal of some unused imports and some minor fixes. #1198

Open
wants to merge 27 commits into
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+155 −229
Split
View
@@ -146,7 +146,6 @@ def update_image(autoscale, name, lc_name, image_id, is_migrate_instances=False)
g = get_group(autoscale, name)
l = get_lc(autoscale, g.launch_config_name)
- old_lc_name = l.name
l.name = lc_name
l.image_id = image_id
autoscale.create_launch_configuration(l)
@@ -197,7 +196,6 @@ if __name__ == "__main__":
import sys
import time
from optparse import OptionParser
- from boto.mashups.iobject import IObject
from boto.ec2.autoscale import AutoScalingGroup
from boto.ec2.autoscale import LaunchConfiguration
parser = OptionParser(version=VERSION, usage=usage)
View
@@ -26,6 +26,7 @@ Options:
-h, --help show help message (including options list) and exit
"""
+import sys
from operator import itemgetter
HEADERS = {
View
@@ -39,9 +39,9 @@ def list_bucket(b, prefix=None):
print "%s\t%s\t%010s\t%s" % (mode, k.last_modified,
sizeof_fmt(size), k.name)
else:
- #If it's not a Key object, it doesn't have a last_modified time, so
- #print nothing instead
- print "%s\t%s\t%010s\t%s" % (mode, ' '*24,
+ #If it's not a Key object, it doesn't have a last_modified time, so
+ #print nothing instead
+ print "%s\t%s\t%010s\t%s" % (mode, ' '*24,
sizeof_fmt(size), k.name)
total += size
print "="*80
@@ -58,12 +58,12 @@ if __name__ == "__main__":
pairs = []
mixedCase = False
for name in sys.argv[1:]:
- if "/" in name:
- pairs.append(name.split("/",1))
- else:
- pairs.append([name, None])
- if pairs[-1][0].lower() != pairs[-1][0]:
- mixedCase = True
+ if "/" in name:
+ pairs.append(name.split("/",1))
+ else:
+ pairs.append([name, None])
+ if pairs[-1][0].lower() != pairs[-1][0]:
+ mixedCase = True
if mixedCase:
s3 = boto.connect_s3(calling_format=OrdinaryCallingFormat())
View
@@ -97,14 +97,15 @@ def save_nicknames(nicknames_path = default_nicknames_path):
if nicknames != original_nicknames:
with open(nicknames_path, 'w') as o:
json.dump(nicknames, o, sort_keys = True, indent = 4)
- print >>o
+ print >> o
time_units = dict(s = 1, min = 60, h = 60 * 60, d = 24 * 60 * 60)
def parse_duration(s):
'''Parses durations like "2 d", "48 h", "2880 min",
"172800 s", or "172800".'''
x = s.split()
return int(x[0]) * time_units['s' if len(x) == 1 else x[1]]
+
def display_duration(n):
for unit, m in sorted(time_units.items(), key = lambda x: -x[1]):
if n % m == 0:
View
@@ -138,8 +138,8 @@ if __name__ == "__main__":
exit()
if not options.dump and not options.load and not options.empty:
- parser.print_help()
- exit()
+ parser.print_help()
+ exit()
View
@@ -93,10 +93,8 @@ if __name__ == "__main__":
import readline
except ImportError:
pass
- import boto
import sys
from optparse import OptionParser
- from boto.mashups.iobject import IObject
parser = OptionParser(version=__version__, usage=usage)
(options, args) = parser.parse_args()
View
@@ -35,13 +35,11 @@
import hmac
import sys
import urllib
-import time
import datetime
import copy
from email.utils import formatdate
from boto.auth_handler import AuthHandler
-from boto.exception import BotoClientError
#
# the following is necessary because of the incompatibilities
# between Python 2.4, 2.5, and 2.6 as well as the fact that some
View
@@ -26,7 +26,7 @@
from plugin import Plugin
class NotReadyToAuthenticate(Exception):
- pass
+ pass
class AuthHandler(Plugin):
@@ -21,7 +21,6 @@
#
import xml.sax
-import time
import boto
from boto.connection import AWSAuthConnection
from boto import handler
@@ -23,7 +23,6 @@
import base64
import time
from boto.compat import json
-from boto.cloudfront.identity import OriginAccessIdentity
from boto.cloudfront.object import Object, StreamingObject
from boto.cloudfront.signers import ActiveTrustedSigners, TrustedSigners
from boto.cloudfront.logging import LoggingInfo
@@ -22,7 +22,6 @@
import uuid
import urllib
-from boto.resultset import ResultSet
class InvalidationBatch(object):
@@ -22,8 +22,6 @@
# IN THE SOFTWARE.
#
-import boto
-from boto.compat import json
from .optionstatus import OptionStatus
from .optionstatus import IndexFieldStatus
from .optionstatus import ServicePoliciesStatus
@@ -22,9 +22,7 @@
# IN THE SOFTWARE.
#
from math import ceil
-import time
import json
-import boto
import requests
View
@@ -48,7 +48,6 @@
import errno
import httplib
import os
-import Queue
import random
import re
import socket
@@ -67,7 +66,7 @@
import boto.cacerts
from boto import config, UserAgent
-from boto.exception import AWSConnectionError, BotoClientError
+from boto.exception import BotoClientError
from boto.exception import BotoServerError
from boto.provider import Provider
from boto.resultset import ResultSet
View
@@ -25,7 +25,6 @@
import hmac
import base64
from hashlib import sha256
-import sys
import datetime
try:
View
@@ -21,7 +21,6 @@
# IN THE SOFTWARE.
#
-from boto.dynamodb.exceptions import DynamoDBItemError
class Item(dict):
View
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from boto.ec2.ec2object import EC2Object, TaggedEC2Object
+from boto.ec2.ec2object import TaggedEC2Object
from boto.ec2.blockdevicemapping import BlockDeviceMapping
class ProductCodes(list):
@@ -22,7 +22,6 @@
Represents an EC2 Placement Group
"""
from boto.ec2.ec2object import EC2Object
-from boto.exception import BotoClientError
class PlacementGroup(EC2Object):
View
@@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from boto.ec2.instancestatus import Status, Details
+from boto.ec2.instancestatus import Status
class Event(object):
"""
View
@@ -20,9 +20,7 @@
# IN THE SOFTWARE.
import boto
-from boto.connection import AWSQueryConnection, AWSAuthConnection
-import time
-import urllib
+from boto.connection import AWSQueryConnection
import xml.sax
from boto.ecs.item import ItemSet
from boto import handler
View
@@ -30,21 +30,21 @@ def jar(self):
:rtype: str
:return: URI to the jar
"""
- raise NotImplemented()
+ raise NotImplementedError()
def args(self):
"""
:rtype: list(str)
:return: List of arguments for the step
"""
- raise NotImplemented()
+ raise NotImplementedError()
def main_class(self):
"""
:rtype: str
:return: The main class name
"""
- raise NotImplemented()
+ raise NotImplementedError()
class JarStep(Step):
View
@@ -19,7 +19,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-import boto
from connection import FileConnection as Connection
from key import Key
View
@@ -23,7 +23,6 @@
#
import os
-import urllib
import boto.glacier
from boto.compat import json
View
@@ -28,7 +28,6 @@
# This import is provided for backwards compatibility. This function is
# now in boto.glacier.utils, but any existing code can still import
# this directly from this module.
-from boto.glacier.utils import compute_hashes_from_fileobj
_ONE_MEGABYTE = 1024 * 1024
View
@@ -20,7 +20,6 @@
# IN THE SOFTWARE.
import types
-from boto.gs.user import User
from boto.exception import InvalidCorsError
from xml.sax import handler
@@ -19,7 +19,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-import cgi
import errno
import httplib
import os
@@ -28,7 +27,6 @@
import socket
import time
import urlparse
-import boto
from boto import config
from boto.connection import AWSAuthConnection
from boto.exception import InvalidUriError
View
@@ -22,7 +22,6 @@
import boto
import boto.jsonresponse
from boto.compat import json
-from boto.resultset import ResultSet
from boto.iam.summarymap import SummaryMap
from boto.connection import AWSQueryConnection
@@ -174,4 +174,4 @@ def endElement(self, name, value, connection):
elif name == 'EC2SecurityGroupOwnerId':
self.owner_id = value
else:
- setattr(self, name, value)
+ setattr(self, name, value)
View
@@ -24,7 +24,6 @@
import boto
from boto import handler
from boto.resultset import ResultSet
-from boto.exception import BotoClientError
from boto.s3.acl import Policy, CannedACLStrings, Grant
from boto.s3.key import Key
from boto.s3.prefix import Prefix
@@ -47,7 +46,6 @@
import StringIO
import urllib
import re
-import base64
from collections import defaultdict
# as per http://goo.gl/BDuud (02/19/2011)
View
@@ -33,7 +33,7 @@
from boto.s3.bucket import Bucket
from boto.s3.key import Key
from boto.resultset import ResultSet
-from boto.exception import BotoClientError, S3ResponseError
+from boto.exception import BotoClientError
def check_lowercase_bucketname(n):
View
@@ -31,7 +31,6 @@
import urllib
import boto.utils
from boto.exception import BotoClientError
-from boto.provider import Provider
from boto.s3.user import User
from boto import UserAgent
from boto.utils import compute_md5
View
@@ -19,8 +19,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
-from boto import handler
-import xml.sax
class Deleted(object):
"""
@@ -25,9 +25,7 @@
import re
import socket
import time
-import boto
from boto import config, storage_uri_for_key
-from boto.connection import AWSAuthConnection
from boto.exception import ResumableDownloadException
from boto.exception import ResumableTransferDisposition
View
@@ -1,5 +1,4 @@
from boto import handler
-import xml.sax
class Tag(object):
View
@@ -26,7 +26,6 @@
from boto.connection import AWSQueryConnection
from boto.sdb.domain import Domain, DomainMetaData
from boto.sdb.item import Item
-from boto.sdb.regioninfo import SDBRegionInfo
from boto.exception import SDBResponseError
class ItemThread(threading.Thread):
View
@@ -25,7 +25,7 @@
from boto.sqs.message import Message
from boto.sqs.attributes import Attributes
from boto.sqs.batchresults import BatchResults
-from boto.exception import SQSError, BotoServerError
+from boto.exception import SQSError
class SQSConnection(AWSQueryConnection):
Oops, something went wrong.