Browse Source

pep8 cleanups

Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Doug Hellmann 2 years ago
parent
commit
9363607553
6 changed files with 9 additions and 32 deletions
  1. 2
    7
      aerostat/app.py
  2. 3
    1
      aerostat/download.py
  3. 1
    20
      aerostat/export.py
  4. 1
    1
      aerostat/query.py
  5. 0
    2
      aerostat/resolver.py
  6. 2
    1
      tox.ini

+ 2
- 7
aerostat/app.py View File

@@ -16,20 +16,14 @@
16 16
 # under the License.
17 17
 
18 18
 import argparse
19
-import os.path
20
-import pprint
19
+import logging
21 20
 import sys
22 21
 
23 22
 import os_client_config
24
-import progressbar
25 23
 import shade
26
-import yaml
27 24
 
28
-from aerostat import download
29 25
 from aerostat import export
30 26
 from aerostat import query
31
-from aerostat import resolver
32
-from aerostat import resources
33 27
 
34 28
 
35 29
 def main():
@@ -84,3 +78,4 @@ def main():
84 78
     args = parser.parse_args(sys.argv[1:])
85 79
 
86 80
     return args.func(config, args)
81
+    return args.func(cloud, config, args)

+ 3
- 1
aerostat/download.py View File

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

+ 1
- 20
aerostat/export.py View File

@@ -15,27 +15,18 @@
15 15
 # License for the specific language governing permissions and limitations
16 16
 # under the License.
17 17
 
18
-import argparse
19 18
 import os.path
20
-import pprint
21
-import sys
22 19
 
23
-import os_client_config
24
-import progressbar
25
-import shade
26 20
 import yaml
27 21
 
28 22
 from aerostat import download
29
-from aerostat import export
30 23
 from aerostat import resolver
31 24
 from aerostat import resources
32 25
 
33 26
 
34
-def export_data(config, args):
27
+def export_data(cloud, config, args):
35 28
     output_path = args.output_path
36 29
 
37
-    cloud_config = config.get_one_cloud(options=(args, []))
38
-    cloud = shade.OpenStackCloud(cloud_config=cloud_config)
39 30
     downloader = download.Downloader(output_path, cloud)
40 31
     res = resolver.Resolver(cloud, downloader)
41 32
     tasks = []
@@ -70,13 +61,3 @@ def export_data(config, args):
70 61
     print('wrote playbook to {}'.format(playbook_filename))
71 62
 
72 63
     downloader.start()
73
-
74
-    # print('downloading volume snapshot')
75
-    # snapshot = cloud.get_volume_snapshot('testvol1-sn1')
76
-    # pprint.pprint(snapshot)
77
-    # # with download.ProgressBarDownloader('testvol1-sn1.dat', snapshot.size) as out:
78
-    # #     cloud.download_image('dev1-sn1', output_file=out)
79
-
80
-    # for volume in dev1.volumes:
81
-    #     vol = cloud.get_volume(volume.id)
82
-    #     pprint.pprint(vol)

+ 1
- 1
aerostat/query.py View File

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

+ 0
- 2
aerostat/resolver.py View File

@@ -15,8 +15,6 @@
15 15
 # License for the specific language governing permissions and limitations
16 16
 # under the License.
17 17
 
18
-import pprint
19
-
20 18
 
21 19
 class Resolver:
22 20
 

+ 2
- 1
tox.ini View File

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

Loading…
Cancel
Save