def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/nodebrowser', config) set_attribute(self, 'secured', False, config, as_boolean) RequestHandler.configure(self, config)
def _add_child(self, child): if isinstance(child,_exporter.Formatter): if self.formatter is not None: raise EInvalidValue('child',child,('Only one formatter can ' + 'be added to an Exporter')) self.formatter = child RequestHandler._add_child(self, child)
def _add_child(self, child): if isinstance(child,_exporter.Formatter): if self.formatter is not None: raise EInvalidValue('child',child,('Only one formatter can ' + 'be added to an Exporter')) self.formatter = child RequestHandler._add_child(self, child)
def start(self): RequestHandler.start(self) self.WEB_ROOT = properties.HTTP_ROOT if self.parent.server_type == 'HTTPS': self.WEB_ROOT = properties.HTTPS_ROOT for handler in self.parent.children_nodes(): if isinstance(handler, FileSpace): self.filespace = handler break err_message = 'PSP handler not running in secured mode because \ no %s was found. Config parameter "secured" \ being overriden to False' if self.secured and self.filespace: try: sm = as_node('/services/Security Manager') except KeyError: msglog.log('broadway', msglog.types.WARN, err_message % 'Security Manager') msglog.exception(prefix='Handled') self.provides_security = self._secured = False else: self.security_manager = sm self.provides_security = self._secured = True else: if self.secured: # not secured because we could not locate filespace object. msglog.log('broadway', msglog.types.WARN, err_message % 'FileSpace manager') self.provides_security = self._secured = False
def start(self): RequestHandler.start(self) self.WEB_ROOT = properties.HTTP_ROOT if self.parent.server_type == 'HTTPS': self.WEB_ROOT = properties.HTTPS_ROOT for handler in self.parent.children_nodes(): if isinstance(handler, FileSpace): self.filespace = handler break err_message = 'PSP handler not running in secured mode because \ no %s was found. Config parameter "secured" \ being overriden to False' if self.secured and self.filespace: try: sm = as_node('/services/Security Manager') except KeyError: msglog.log('broadway', msglog.types.WARN, err_message % 'Security Manager') msglog.exception(prefix = 'Handled') self.provides_security = self._secured = False else: self.security_manager = sm self.provides_security = self._secured = True else: if self.secured: # not secured because we could not locate filespace object. msglog.log('broadway', msglog.types.WARN, err_message % 'FileSpace manager') self.provides_security = self._secured = False
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/nodebrowser', config) self.secured = as_internal_node("/services").secured RequestHandler.configure(self, config)
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/backup', config) self.secured = as_internal_node("/services").secured RequestHandler.configure(self, config) return
def __init__(self): RequestHandler.__init__(self) self.security_manager = None self.provides_security = None self.filespace = None self.cache = {} self.html = '' self.ROOT_DIR = None
def configure(self, config): set_attribute(self, 'request_path', REQUIRED, config) set_attribute(self, 'gm_time', 0, config, as_boolean) RequestHandler.configure(self, config) self.time = _TimeStore(self) self.time_function = time.localtime if self.gm_time: self.time_function = time.gmtime
def __init__(self): RequestHandler.__init__(self) self.security_manager = None self.provides_security = None self.filespace = None self.cache = {} self.html = '' self.ROOT_DIR = None
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '^/msglog/.*|^/msglog$', config) RequestHandler.configure(self, config) self.http_published_root = properties.HTTP_ROOT self.handlers = [] self.install_handlers()
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '^/msglog/.*|^/msglog$', config) RequestHandler.configure(self, config) self.http_published_root = properties.HTTP_ROOT self.handlers = [] self.install_handlers()
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/configfile', config) set_attribute(self, 'debug', 0, config, as_boolean) set_attribute(self, 'safe_save', 1, config, as_boolean) set_attribute(self, 'keep_backup', 0, config, as_boolean) set_attribute(self, 'authentication', "BASIC", config) RequestHandler.configure(self, config)
def configure(self, config): RequestHandler.configure(self, config) ## # @attribute log_n_exceptions: # log_n_exceptions == 0 - don't log RNA exceptions # log_n_exceptions < 0 - log all RNA exceptions # log_n_exceptions > 0 - log LOG_N_EXCEPTIONS RNA exceptions and # then stop. set_attribute(self, 'log_n_exceptions', 0, config) return
def configure(self, config): RequestHandler.configure(self, config) ## # @attribute log_n_exceptions: # log_n_exceptions == 0 - don't log RNA exceptions # log_n_exceptions < 0 - log all RNA exceptions # log_n_exceptions > 0 - log LOG_N_EXCEPTIONS RNA exceptions and # then stop. set_attribute(self, 'log_n_exceptions', 0, config) return
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/enerwise', config) set_attribute(self, 'minimum_backup', 1, config, _days_to_seconds) set_attribute(self, 'type', 'exporter', config) set_attribute(self, 'log', REQUIRED, config, as_node) RequestHandler.configure(self, config) self.time = _TimeStore(self)
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/enerwise', config) set_attribute(self, 'minimum_backup', 1, config, _days_to_seconds) set_attribute(self, 'type', 'exporter', config) set_attribute(self, 'log', REQUIRED, config, as_node) RequestHandler.configure(self, config) self.time = _TimeStore(self)
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, "request_path", "/configfile", config) set_attribute(self, "debug", 0, config, as_boolean) set_attribute(self, "safe_save", 1, config, as_boolean) set_attribute(self, "keep_backup", 0, config, as_boolean) set_attribute(self, "authentication", "BASIC", config) RequestHandler.configure(self, config)
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', REQUIRED, config) set_attribute(self, 'log', REQUIRED, config, as_node) set_attribute(self, 'gm_time', 0, config, as_boolean) RequestHandler.configure(self, config) self.time = _TimeStore(self) self.time_function = time.localtime if self.gm_time: self.time_function = time.gmtime
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', REQUIRED, config) set_attribute(self, 'log', REQUIRED, config, as_node) set_attribute(self, 'gm_time', 0, config, as_boolean) RequestHandler.configure(self, config) self.time = _TimeStore(self) self.time_function = time.localtime if self.gm_time: self.time_function = time.gmtime
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'secured', config, str) get_attribute(self, 'provides_security', config) get_attribute(self, 'authentication', config) return config
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'minimum_backup', config, _seconds_to_days) get_attribute(self, 'type', config) get_attribute(self, 'log', config, as_node_url) return config
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'secured', config, str) get_attribute(self, 'provides_security', config) get_attribute(self, 'authentication', config) return config
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'minimum_backup', config, _seconds_to_days) get_attribute(self, 'type', config) get_attribute(self, 'log', config, as_node_url) return config
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'debug', config) get_attribute(self, 'safe_save', config) get_attribute(self, 'keep_backup', config) get_attribute(self, 'authentication', config) return config
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, "request_path", config) get_attribute(self, "debug", config) get_attribute(self, "safe_save", config) get_attribute(self, "keep_backup", config) get_attribute(self, "authentication", config) return config
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/xmlrpc', config) set_attribute(self, 'deployed_objects', [], config) set_attribute(self, 'debug', 0, config) # requires_authentication is deprecated; provides_security more obvious. provides_security = config.get('requires_authentication', 1) set_attribute(self, 'provides_security', provides_security, config, as_boolean) self.secured = as_internal_node("/services").secured RequestHandler.configure(self, config) if self.secured: rna_xmlrpc = 'mpx.lib.xmlrpc.rna_xmlrpc.SecuredXmlRpcHandler' rna_xmlrpc2 = 'mpx.lib.xmlrpc.rna_xmlrpc.SecuredXmlRpcHandler2' else: rna_xmlrpc = 'mpx.lib.xmlrpc.rna_xmlrpc.RNA_XMLRPC_Handler' rna_xmlrpc2 = 'mpx.lib.xmlrpc.rna_xmlrpc.RNA_XMLRPC_Handler2' ## Pre-Register important XMLRPC Objects such RNA ## rna_xmlrpc -- Default RNA over XMLRPC handler child = XMLRPC_Deploy() params = { 'name': 'rna_xmlrpc', 'alias': 'rna_xmlrpc', 'class_name': rna_xmlrpc, 'lifetime': 'Runtime', 'parent': self } child.configure(params) ## rna_xmlrpc2 -- Next Generation RNA over XMLRPC handler child = XMLRPC_Deploy() params = { 'name': 'rna_xmlrpc2', 'alias': 'rna_xmlrpc2', 'class_name': rna_xmlrpc2, 'lifetime': 'Runtime', 'parent': self } child.configure(params)
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/XMLRPCv2', config) set_attribute(self, 'debug', 0, config) # requires_authentication is deprecated; provides_security more obvious. provides_security = config.get('requires_authentication', 1) set_attribute( self, 'provides_security', provides_security, config, as_boolean) self.secured = as_internal_node("/services").secured set_attribute(self, 'authentication', 'basic', config) if self.authentication not in ('digest','basic','form'): raise EInvalidValue('authentication',self.authentication, 'Authentication scheme not recognized.') RequestHandler.configure(self, config) # create the inherient child RNA if not self.has_child('RNA'): rna = RNA() config = {'parent':self,'name':'RNA', 'log_n_exceptions':0} rna.configure(config) return
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/XMLRPCv2', config) set_attribute(self, 'debug', 0, config) # requires_authentication is deprecated; provides_security more obvious. provides_security = config.get('requires_authentication', 1) set_attribute(self, 'provides_security', provides_security, config, as_boolean) self.secured = as_internal_node("/services").secured set_attribute(self, 'authentication', 'basic', config) if self.authentication not in ('digest', 'basic', 'form'): raise EInvalidValue('authentication', self.authentication, 'Authentication scheme not recognized.') RequestHandler.configure(self, config) # create the inherient child RNA if not self.has_child('RNA'): rna = RNA() config = {'parent': self, 'name': 'RNA', 'log_n_exceptions': 0} rna.configure(config) return
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '/xmlrpc', config) set_attribute(self, 'deployed_objects',[],config) set_attribute(self, 'debug', 0, config) # requires_authentication is deprecated; provides_security more obvious. provides_security = config.get('requires_authentication', 1) set_attribute( self, 'provides_security', provides_security, config, as_boolean) self.secured = as_internal_node("/services").secured RequestHandler.configure(self, config) if self.secured: rna_xmlrpc = 'mpx.lib.xmlrpc.rna_xmlrpc.SecuredXmlRpcHandler' rna_xmlrpc2 = 'mpx.lib.xmlrpc.rna_xmlrpc.SecuredXmlRpcHandler2' else: rna_xmlrpc = 'mpx.lib.xmlrpc.rna_xmlrpc.RNA_XMLRPC_Handler' rna_xmlrpc2 = 'mpx.lib.xmlrpc.rna_xmlrpc.RNA_XMLRPC_Handler2' ## Pre-Register important XMLRPC Objects such RNA ## rna_xmlrpc -- Default RNA over XMLRPC handler child = XMLRPC_Deploy() params = {'name':'rna_xmlrpc', 'alias':'rna_xmlrpc', 'class_name': rna_xmlrpc, 'lifetime':'Runtime', 'parent':self} child.configure(params) ## rna_xmlrpc2 -- Next Generation RNA over XMLRPC handler child = XMLRPC_Deploy() params = {'name':'rna_xmlrpc2', 'alias':'rna_xmlrpc2', 'class_name': rna_xmlrpc2, 'lifetime':'Runtime', 'parent':self} child.configure(params)
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'secured', config, str) return config
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'log_n_exceptions', config) return config
def configure(self, config): RequestHandler.configure(self, config) set_attribute(self, 'request_path', 'alarms', config)
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config)
def __init__(self): self.formatter = None RequestHandler.__init__(self)
def start(self): RequestHandler.start(self)
def configure(self, config): RequestHandler.configure(self, config) set_attribute(self,'request_path','alarms',config)
def configure(self,config): RequestHandler.configure(self,config) set_attribute(self,'request_path','.*\.psp$',config) set_attribute(self, 'provides_security', 1, config, as_boolean) self.secured = as_boolean(as_internal_node("/services").secured) self.request_regex = re.compile(self.request_path)
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'log', config, as_node_url) return config
def __init__(self): RequestHandler.__init__(self) self.b_service = as_deferred_node('/services/backup_registry')
def _add_child(self, child): if child.type == _exporter.ChildrenTypes.FORMATTER: self.formatter = child RequestHandler._add_child(self, child)
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '^/properties$', config) RequestHandler.configure(self, config)
def configure(self, config): # The request_path tells the http_server which url requests # should be sent to this handler. It can be a regular expression # as defined in the documentation for the python re module. set_attribute(self, 'request_path', '^/properties$', config) RequestHandler.configure(self, config)
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'log_n_exceptions', config) return config
def __init__(self): self.formatter = None RequestHandler.__init__(self)
def __init__(self): RequestHandler.__init__(self)
def start(self): RequestHandler.start(self)
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config)
def _add_child(self, child): if child.type == _exporter.ChildrenTypes.FORMATTER: self.formatter = child RequestHandler._add_child(self, child)
def configure(self, config): RequestHandler.configure(self, config) set_attribute(self, 'request_path', '.*\.psp$', config) set_attribute(self, 'provides_security', 1, config, as_boolean) self.secured = as_boolean(as_internal_node("/services").secured) self.request_regex = re.compile(self.request_path)
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'log', config, as_node_url) return config
def configuration(self): config = RequestHandler.configuration(self) get_attribute(self, 'request_path', config) get_attribute(self, 'secured', config, str) return config
def __init__(self): RequestHandler.__init__(self) self.b_service = as_deferred_node('/services/backup_registry')