-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathawsloader.py
33 lines (27 loc) · 1.02 KB
/
awsloader.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2010, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
import logging
log = logging.getLogger('zen.AWSLoader')
from zope.interface import implements
from transaction import commit
from Products.Zuul import getFacade
from Products.ZenModel.interfaces import IDeviceLoader
class AWSLoader(object):
implements(IDeviceLoader)
"""
Loader for the ZenAWS ZenPack
"""
def load_device(self, dmd, access_id, secret,
path='', windowspath=''):
getFacade('aws', dmd).configure(
access_id, secret, path, windowspath)
commit()
mgrPath = '/zport/dmd/Devices/AWS/EC2/devices/EC2Manager'
mgr = dmd.restrictedTraverse(mgrPath)
mgr.collectDevice()