Trees | Indices | Help |
---|
|
1 # 2 # Copyright (c) 2008--2013 Red Hat, Inc. 3 # 4 # This software is licensed to you under the GNU General Public License, 5 # version 2 (GPLv2). There is NO WARRANTY for this software, express or 6 # implied, including the implied warranties of MERCHANTABILITY or FITNESS 7 # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 8 # along with this software; if not, see 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 10 # 11 # Red Hat trademarks are not licensed under GPLv2. No permission is 12 # granted to use or replicate Red Hat trademarks that are incorporated 13 # in this software or its documentation. 14 # 15 16 # 17 # This module defines notification-related functions and constants, for use 18 # with the client-side virtualization code. 19 # 20 21 import sys 22 23 import time 24 25 from up2date_client import up2dateAuth 26 from up2date_client import up2dateErrors 27 from up2date_client import rhnserver 28 from up2date_client import up2dateLog 29 from virtualization.errors import NotRegistered 30 31 log = up2dateLog.initLog() 32 33 ############################################################################### 34 # Constants 35 ############################################################################### 3638 EXISTS = 'exists' 39 REMOVED = 'removed' 40 CRAWL_BEGAN = 'crawl_began' 41 CRAWL_ENDED = 'crawl_ended'42 47 48 ############################################################################### 49 # Plan Class 50 ############################################################################### 5153 569058 """ 59 Creates a new plan item and adds it to the list. 60 """ 61 self.__items.append(self.__make_item(event, target, properties))6264 """ 65 Sends all items in the plan to the satellite. 66 """ 67 systemid = up2dateAuth.getSystemId() 68 69 if systemid is None: 70 raise NotRegistered("System ID not found.") 71 72 server = rhnserver.RhnServer() 73 74 try: 75 server.registration.virt_notify(systemid, self.__items) 76 except up2dateErrors.CommunicationError: 77 e = sys.exc_info()[1] 78 log.trace_me() 79 log.log_me(e)80 8183 """ 84 Creates a new plan item. 85 """ 86 87 # Get the current time. 88 current_time = int(time.time()) 89 return ( current_time, event, target, properties )
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Mar 4 07:37:44 2020 | http://epydoc.sourceforge.net |