pep8 cleanups

Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-01-31 17:24:47 -05:00
parent 6b086aeeb7
commit 9363607553
6 changed files with 9 additions and 32 deletions

View File

@ -16,20 +16,14 @@
# under the License.
import argparse
import os.path
import pprint
import logging
import sys
import os_client_config
import progressbar
import shade
import yaml
from aerostat import download
from aerostat import export
from aerostat import query
from aerostat import resolver
from aerostat import resources
def main():
@ -84,3 +78,4 @@ def main():
args = parser.parse_args(sys.argv[1:])
return args.func(config, args)
return args.func(cloud, config, args)

View File

@ -79,7 +79,9 @@ class Downloader:
# FIXME(dhellmann): start downloads in a separate thread or process
for resource_type, resource, output_path in self._tasks:
if os.path.exists(output_path):
print('output file {} already exists, skipping download'.format(output_path))
print(
'output file {} already exists, skipping download'.format(
output_path))
continue
if resource_type == 'image':
print('downloading image {} to {}'.format(

View File

@ -15,27 +15,18 @@
# License for the specific language governing permissions and limitations
# under the License.
import argparse
import os.path
import pprint
import sys
import os_client_config
import progressbar
import shade
import yaml
from aerostat import download
from aerostat import export
from aerostat import resolver
from aerostat import resources
def export_data(config, args):
def export_data(cloud, config, args):
output_path = args.output_path
cloud_config = config.get_one_cloud(options=(args, []))
cloud = shade.OpenStackCloud(cloud_config=cloud_config)
downloader = download.Downloader(output_path, cloud)
res = resolver.Resolver(cloud, downloader)
tasks = []
@ -70,13 +61,3 @@ def export_data(config, args):
print('wrote playbook to {}'.format(playbook_filename))
downloader.start()
# print('downloading volume snapshot')
# snapshot = cloud.get_volume_snapshot('testvol1-sn1')
# pprint.pprint(snapshot)
# # with download.ProgressBarDownloader('testvol1-sn1.dat', snapshot.size) as out:
# # cloud.download_image('dev1-sn1', output_file=out)
# for volume in dev1.volumes:
# vol = cloud.get_volume(volume.id)
# pprint.pprint(vol)

View File

@ -16,5 +16,5 @@
# under the License.
def query_data(config, args):
def query_data(cloud, config, args):
raise NotImplementedError('query not implemented')

View File

@ -15,8 +15,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import pprint
class Resolver:

View File

@ -37,6 +37,7 @@ commands = oslo_debug_helper {posargs}
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
ignore = E123,E125,H238
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
max-line-length = 90