Package backend :: Package satellite_tools :: Module satCerts
[hide private]
[frames] | no frames]

Module satCerts

source code

Classes [hide private]
  CaCertInsertionError
Functions [hide private]
 
get_certificate_info(cert_str) source code
 
verify_certificate_dates(cert_str) source code
 
get_all_orgs()
Fetch org_id.
source code
 
lookup_cert(description, org_id) source code
 
_checkCertMatch_rhnCryptoKey(cert, description, org_id, deleteRowYN=0, verbosity=0)
is there an CA SSL certificate already in the database? If yes: return ID: -1, then no cert in DB None if they are identical (i.e., nothing to do) 0...N if cert is in database
source code
 
_insertPrep_rhnCryptoKey(rhn_cryptokey_id, description, org_id)
inserts a row given that a cert is not already in the database lob rewrite occurs later during update.
source code
 
_lobUpdate_rhnCryptoKey(rhn_cryptokey_id, cert)
writes/updates the cert as a lob
source code
 
store_CaCert(description, caCert, verbosity=0) source code
 
store_rhnCryptoKey(description, cert, org_id, verbosity=0)
stores cert in rhnCryptoKey...
source code
 
delete_rhnCryptoKey_null_org(description_prefix) source code
 
_test_store_rhnCryptoKey(caCert) source code
Variables [hide private]
  _queryLookupOrgId = <spacewalk.server.rhnSQL.sql_base.Statemen...
  _queryDeleteCryptoCertInfoNullOrg = <spacewalk.server.rhnSQL.s...
  _querySelectCryptoCertInfo = <spacewalk.server.rhnSQL.sql_base...
  _querySelectCryptoCertInfoNullOrg = <spacewalk.server.rhnSQL.s...
  _queryInsertCryptoCertInfo = <spacewalk.server.rhnSQL.sql_base...
  __package__ = 'backend.satellite_tools'
Function Details [hide private]

get_all_orgs()

source code 
Fetch org_id. Create first org_id if needed.
owner only needed if no org_id present
NOTE: this is duplicated elsewhere (backend.py)
      but I need the error differientiation of (1) too many orgs
      and (2) no orgs. backend.py does not differientiate.

_checkCertMatch_rhnCryptoKey(cert, description, org_id, deleteRowYN=0, verbosity=0)

source code 
is there an CA SSL certificate already in the database?
If yes:
    return ID:
      -1, then no cert in DB
      None if they are identical (i.e., nothing to do)
      0...N if cert is in database

if found, optionally deletes the row and returns -1
Used ONLY by: store_rhnCryptoKey(...)

_insertPrep_rhnCryptoKey(rhn_cryptokey_id, description, org_id)

source code 

inserts a row given that a cert is not already in the database lob rewrite occurs later during update. Used ONLY by: store_rhnCryptoKey(...)

store_rhnCryptoKey(description, cert, org_id, verbosity=0)

source code 
stores cert in rhnCryptoKey
uses:
    _checkCertMatch_rhnCryptoKey
    _delete_rhnCryptoKey - not currently used
    _insertPrep_rhnCryptoKey
    _lobUpdate_rhnCryptoKey


Variables Details [hide private]

_queryLookupOrgId

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081771966\
4; statement=
    SELECT id
      FROM web_customer

_queryDeleteCryptoCertInfoNullOrg

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081771980\
8; statement=
    DELETE FROM rhnCryptoKey ck
    WHERE ck.description LIKE :description_prefix || '%%'
      AND ck.crypto_key_type_id = (SELECT id FROM rhnCryptoKeyType WHE\
RE label = 'SSL')
      AND ck.org_id is NULL

_querySelectCryptoCertInfo

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081771988\
0; statement=
    SELECT ck.id, ck.description, ckt.label as type_label, ck.key
      FROM rhnCryptoKeyType ckt,
           rhnCryptoKey ck
     WHERE ckt.label = 'SSL'
       AND ckt.id = ck.crypto_key_type_id
       AND ck.description = :description
...

_querySelectCryptoCertInfoNullOrg

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081771995\
2; statement=
    SELECT ck.id, ck.description, ckt.label as type_label, ck.key
      FROM rhnCryptoKeyType ckt,
           rhnCryptoKey ck
     WHERE ckt.label = 'SSL'
       AND ckt.id = ck.crypto_key_type_id
       AND ck.description = :description
...

_queryInsertCryptoCertInfo

Value:
<spacewalk.server.rhnSQL.sql_base.Statement instance at 13998081772002\
4; statement=
    INSERT into rhnCryptoKey
           (id, org_id, description, crypto_key_type_id, key)
    SELECT :rhn_cryptokey_id, :org_id, :description, ckt.id, empty_blo\
b()
      FROM rhnCryptoKeyType ckt
     WHERE ckt.label = 'SSL'
...