Beispiel #1
0
 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)
Beispiel #3
0
 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)
Beispiel #4
0
    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
Beispiel #5
0
 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
Beispiel #6
0
 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)
Beispiel #7
0
 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
Beispiel #8
0
 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
Beispiel #10
0
 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
Beispiel #11
0
 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()  
Beispiel #12
0
 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()
Beispiel #13
0
 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)
Beispiel #14
0
 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
Beispiel #15
0
 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
Beispiel #16
0
 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)
Beispiel #17
0
 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)
Beispiel #18
0
 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)
Beispiel #19
0
 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
Beispiel #20
0
 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
Beispiel #21
0
 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
Beispiel #22
0
 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
Beispiel #23
0
 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
Beispiel #24
0
 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
Beispiel #25
0
 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
Beispiel #26
0
 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
Beispiel #27
0
 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)
Beispiel #28
0
 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
Beispiel #29
0
 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
Beispiel #30
0
 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)
Beispiel #31
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'request_path', config)
     get_attribute(self, 'secured', config, str)
     return config
Beispiel #32
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'log_n_exceptions', config)
     return config
Beispiel #33
0
 def configure(self, config):
     RequestHandler.configure(self, config)
     set_attribute(self, 'request_path', 'alarms', config)
Beispiel #34
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'request_path', config)
 def __init__(self):
     self.formatter = None
     RequestHandler.__init__(self)
Beispiel #36
0
 def start(self):
     RequestHandler.start(self)
Beispiel #37
0
 def configure(self, config):
     RequestHandler.configure(self, config)
     set_attribute(self,'request_path','alarms',config)
Beispiel #38
0
 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)
Beispiel #39
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'request_path', config)
     get_attribute(self, 'log', config, as_node_url)
     return config
Beispiel #40
0
 def __init__(self):
     RequestHandler.__init__(self)
     self.b_service = as_deferred_node('/services/backup_registry')
Beispiel #41
0
 def _add_child(self, child):
     if child.type == _exporter.ChildrenTypes.FORMATTER:
         self.formatter = child
     RequestHandler._add_child(self, child)
Beispiel #42
0
 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)
Beispiel #44
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'log_n_exceptions', config)
     return config
Beispiel #45
0
 def __init__(self):
     self.formatter = None
     RequestHandler.__init__(self)
 def __init__(self):
     RequestHandler.__init__(self)
Beispiel #47
0
 def start(self):
     RequestHandler.start(self)
Beispiel #48
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'request_path', config)
Beispiel #49
0
 def _add_child(self, child):
     if child.type == _exporter.ChildrenTypes.FORMATTER:
         self.formatter = child
     RequestHandler._add_child(self, child)
Beispiel #50
0
 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)
Beispiel #51
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'request_path', config)
     get_attribute(self, 'log', config, as_node_url)
     return config
Beispiel #52
0
 def configuration(self):
     config = RequestHandler.configuration(self)
     get_attribute(self, 'request_path', config)
     get_attribute(self, 'secured', config, str)
     return config
Beispiel #53
0
 def __init__(self):
     RequestHandler.__init__(self)
     self.b_service = as_deferred_node('/services/backup_registry')