Beispiel #1
0
  def GetProperties(self):
    if not self.properties:
      self.version=3

    if self.user:
      user=self.user
    else:
      user=xlt("anonymous")
    self.properties= [
       ( xlt("Name"),self.name),
       ( xlt("Version"), self.version),
       ( xlt("Address"), self.address),
       ( xlt("Ldap Base"), self.dn),
       ( xlt("Security"), self.settings['security']),
       ( xlt("Port"), self.settings["port"]),
       ( xlt("User"), user),
       ( xlt("Connected"), YesNo(self.IsConnected())),
       ( xlt("Autoconnect"), YesNo(self.settings.get('autoconnect'))),
       ]

    if self.connection.base:
      for name, val in self.connection.base.items():
        self.AddChildrenProperty(val, name, -1)
    if self.adminLdapDn:
      self.properties.append( (xlt("Admin Config DN"), self.adminLdapDn))
    else:
      self.properties.append( (xlt("Instrumentation"), xlt("not instrumented")) )
    if self.registrationChanged:
      self.properties.append( (xlt("Registration"), xlt("Registration changed"), adm.images['attention']) )

    return self.properties
Beispiel #2
0
    def GetProperties(self):
        if not self.properties:
            sec = self.settings['security']
            if sec.startswith('SSL'):
                pass
            elif sec.startswith('TLS'):
                if self.connection.tls: sec = "TLS"
                else: sec = xlt("unsecured connection")

            self.annotations = self.connection.GetAnnotations('')

            self.properties = [
                (xlt("Name"), self.name),
                (xlt("Protocol"), self.connection.PROTOCOL_VERSION),
                (xlt("Address"), self.address),
                (xlt("Security"), sec),
                (xlt("Port"), self.settings["port"]),
                (xlt("User"), self.user),
                (xlt("Connected"), YesNo(self.IsConnected())),
                (xlt("Autoconnect"), YesNo(self.settings.get('autoconnect'))),
            ]
            self.AddProperty("Server", self.connection.id.get('name'))
            self.AddProperty("Version", self.connection.id.get('version'))
            fs = self.annotations.Get('/freespace')
            if fs != None:
                self.AddSizeProperty(xlt("Free space"), float(fs) * 1024)


#      if self.IsConnected():
#        self.AddChildrenProperty(list(self.connection.capabilities), xlt("Capabilities"), -1)
        return self.properties
Beispiel #3
0
 def GetProperties(self):
     if not self.properties:
         missing = self.NeedsInstrumentation()
         if missing:
             instr = xlt("incomplete: %s missing" % ",".join(missing))
         else:
             instr = xlt("fully instrumented")
         self.properties = [
             (xlt("Name"), self.name),
             (xlt("Version"), self.info['version']),
             (xlt("Address"), self.address),
             (xlt("Maintenance DB"), self.maintDb),
             (xlt("Security"), self.settings['security']),
             (xlt("Port"), self.settings["port"]),
             (xlt("User"), self.user),
             (xlt("Connected"), YesNo(self.IsConnected())),
             (xlt("Autoconnect"), YesNo(self.settings.get('autoconnect'))),
             (xlt("Autovacuum"), YesNo(self.info['autovacuum'])),
             (xlt("Instrumentation"), instr),
         ]
     return self.properties
Beispiel #4
0
    def GetProperties(self):
        if not len(self.properties):

            self.properties = [
                (xlt("Name"), self.name, self.GetImageId('Role')),
                ("OID", self.info['oid']),
                (xlt("Can Login"), YesNo(self.info['rolcanlogin'])),
                (xlt("Superuser"), YesNo(self.info['rolsuper'])),
                (xlt("Catalog Update"), YesNo(self.info['rolcatupdate'])),
                (xlt("Create DB"), YesNo(self.info['rolcreatedb'])),
                (xlt("Create Role"), YesNo(self.info['rolcreaterole'])),
                (xlt("Inherits rights"), YesNo(self.info['rolinherit'])),
            ]
            until = self.info['rolvaliduntil']
            if not until or until.year == 9999:
                until = xlt("never")
            else:
                until = prettyDate(until)
            self.properties.append((xlt("Expires"), until))

            self.AddChildrenProperty(self.info['memberof'], xlt("Member of"),
                                     self.GetImageId("Group"))
            self.AddChildrenProperty(self.info['members'], xlt("Members"),
                                     self.GetImageId("User"))
            self.AddChildrenProperty(self.info['rolconfig'], xlt("Variables"),
                                     -1)

        return self.properties
Beispiel #5
0
  def GetProperties(self):
    if not len(self.properties):
      dict=self.GetCursor().ExecuteDict("""
          SELECT 'languages', array_agg(lanname) as lannames 
            FROM (SELECT lanname FROM pg_language ORDER BY lanispl desc, lanname) AS langlist""")
      self.info.update(dict)
      if self.GetServer().version >= 9.1:
        dict=self.GetCursor().ExecuteDict("""
          SELECT 'extensions', array_agg(name) as extnames
            FROM (SELECT extname || ' V' || extversion AS name FROM pg_extension ORDER BY extname) AS extlist
          UNION
          SELECT 'available_extensions', array_agg(name) as extnames
            FROM (SELECT name || ' V' || default_version AS name FROM pg_available_extensions WHERE installed_version is null ORDER BY name) AS avextlist
          """)
        self.info.update(dict)
          
          
        
      self.properties = [
        (xlt("Name"),           self.name),
        (  "OID" ,              self.info['oid']),
        (xlt("Owner"),          self.info['dbowner']),
        (xlt("Tablespace"),     self.info['spcname']),
        (xlt("Encoding"),       self.info['pgencoding']),
        (xlt("Connected"),      YesNo(self.IsConnected())),
      ]

      self.AddProperty(xlt("Backend PID"), self.GetCursor().GetPid())
      if self.info['datistemplate']:
        self.AddYesNoProperty(xlt("Template"), True)
      if 'datctype' in self.info:
        self.AddProperty(xlt("Collate"), self.info['datcollate'])
        self.AddProperty(xlt("CType"), self.info['datctype'])
      self.AddProperty(xlt("Languages"), ", ".join(self.info['languages']))
      ext=self.info.get('extensions')
      if ext != None:
        if ext:
          ext=", ".join(ext)
        self.AddProperty(xlt("Installed Extensions"), ext)
        avext=self.info.get('available_extensions')
        if avext:
          avext=", ".join(avext)
        self.AddProperty(xlt("Available Extensions"), avext)
      self.AddProperty(xlt("Description"), self.info['description'])
    return self.properties
Beispiel #6
0
 def GetProperties(self):
     if not self.properties:
         self.properties = [
             (xlt("Name"), self.name),
             #         ( xlt("Version"), self.info['version']),
             (xlt("Address"), self.address),
             (xlt("Port"), self.settings["port"]),
             (xlt("Stats Port"), self.settings.get("statsport")),
             (xlt("Key name"), self.settings.get("keyname")),
             (xlt("Autoconnect"), YesNo(self.settings.get('autoconnect'))),
         ]
         self.AddProperty(xlt("BIND Version"), self.bindVersion)
         self.AddProperty(xlt("Server Boot"), self.serverBoot)
         zimg = self.GetImageId("Zone")
         for viewname, zones in self.viewzones.items():
             self.AddChildrenProperty(
                 sorted(zones),
                 xlt("Zones in view \"%s\"") % viewname, zimg)
     return self.properties
Beispiel #7
0
    def GetProperties(self):
        if not len(self.properties):
            args = self.info.get('arguments')
            if args == None:
                logger.error("PGSQL < 8.4; no function args/returns")
                args = ""
                self.info['arguments'] = ""
                self.info['result'] = ""
            self.info['definition'] = None
            result = self.info.get('result', "")
            self.properties = [
                (xlt("Name"), "%s(%s)" % (self.info['name'], args)),
                (xlt("Namespace"), self.info['nspname']),
                (xlt("Language"), self.info['lanname']),
                (xlt("Strict"), YesNo(self.info['proisstrict'])),
                ("OID", self.info['oid']), (xlt("Returns"), result),
                (xlt("Owner"), self.info['owner']),
                (xlt("ACL"), self.info['acl'])
            ]

            self.AddProperty(xlt("Description"), self.info['description'])
        return self.properties