Skip to content

Commit cd525b2

Browse files
committed
fix import when calling ezmomi binary
1 parent 7759ce5 commit cd525b2

File tree

4 files changed

+14
-39
lines changed

4 files changed

+14
-39
lines changed

MANIFEST

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
LICENSE.txt
2+
requirements.txt
3+
setup.py
4+
bin/ezmomi
5+
ezmomi/__init__.py
6+
ezmomi/cli.py
7+
ezmomi/ezmomi.py
8+
ezmomi/params.py
9+
ezmomi/config/config.yml.example

bin/ezmomi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
from ezmomi import cli
33
if __name__ == '__main__':
4-
cli()
4+
cli.cli()

ezmomi/cli.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
'''
2+
Command line definitions for ezmomi
3+
'''
14
import argparse
25
from params import add_params
36

4-
5-
'''
6-
Start 'er up
7-
'''
87
def cli():
98
# Set up command line arguments
109
parser = argparse.ArgumentParser(description='Perform common vSphere API tasks')

ezmomi/ezmomi.py

+1-34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
from pyVim.connect import SmartConnect, Disconnect
23
from pyVmomi import vim, vmodl
34
import atexit
@@ -11,10 +12,6 @@
1112
import yaml
1213
import logging
1314
from netaddr import IPNetwork, IPAddress
14-
<<<<<<< HEAD:ezmomi/ezmomi.py
15-
=======
16-
from params import add_params
17-
>>>>>>> 4a40ac7d460bdbb1402989e35540ecb57df4f881:ezmomi.py
1815

1916
'''
2017
Logging
@@ -314,33 +311,3 @@ def WaitTask(self, task, actionName='job', hideResult=False):
314311
raise task.info.error
315312

316313
return task.info.result
317-
<<<<<<< HEAD:ezmomi/ezmomi.py
318-
=======
319-
320-
'''
321-
Ye Olde Main
322-
'''
323-
if __name__ == '__main__':
324-
# Set up command line arguments
325-
parser = argparse.ArgumentParser(description='Perform common vSphere API tasks')
326-
subparsers = parser.add_subparsers(help='Command', dest='mode')
327-
328-
# set up each command section
329-
add_params(subparsers)
330-
331-
# parse arguments
332-
args = parser.parse_args()
333-
334-
# initialize ezmomi instance
335-
ez = EZMomi(**vars(args))
336-
337-
kwargs = vars(args)
338-
339-
# choose your adventure
340-
if kwargs['mode'] == 'list':
341-
ez.list_objects()
342-
elif kwargs['mode'] == 'clone':
343-
ez.clone()
344-
elif kwargs['mode'] == 'destroy':
345-
ez.destroy()
346-
>>>>>>> 4a40ac7d460bdbb1402989e35540ecb57df4f881:ezmomi.py

0 commit comments

Comments
 (0)