pep8 cleanups
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
6b086aeeb7
commit
9363607553
@ -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)
|
||||
|
@ -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(
|
||||
|
@ -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)
|
||||
|
@ -16,5 +16,5 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
def query_data(config, args):
|
||||
def query_data(cloud, config, args):
|
||||
raise NotImplementedError('query not implemented')
|
||||
|
@ -15,8 +15,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import pprint
|
||||
|
||||
|
||||
class Resolver:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user