remove commented code

This commit is contained in:
Roland Shoemaker 2015-05-25 01:06:59 +01:00
parent 32ceb83718
commit 1d65bed82e
2 changed files with 6 additions and 29 deletions

View File

@ -56,7 +56,10 @@ func loadConfig(c *cli.Context) (config cmd.Config, err error) {
return
}
func setupContext(c cmd.Config) (rpc.CertificateAuthorityClient, *blog.AuditLogger, *gorp.DbMap) {
func setupContext(context *cli.Context) (rpc.CertificateAuthorityClient, *blog.AuditLogger, *gorp.DbMap) {
c, err := loadConfig(context)
cmd.FailOnError(err, "Failed to load Boulder configuration")
ch := cmd.AmqpChannel(c.AMQP.Server)
cac, err := rpc.NewCertificateAuthorityClient(c.AMQP.CA.Client, c.AMQP.CA.Server, ch)
@ -155,16 +158,13 @@ func main() {
Name: "serial-revoke",
Usage: "Revoke a single certificate by the hex serial number",
Action: func(c *cli.Context) {
config, err := loadConfig(c)
cmd.FailOnError(err, "Failed to load Boulder configuration")
// 1: serial, 2: reasonCode (3: deny flag)
serial := c.Args().First()
reasonCode, err := strconv.Atoi(c.Args().Get(2))
cmd.FailOnError(err, "Reason code argument must be a integer")
deny := c.GlobalBool("deny")
cac, auditlogger, dbMap := setupContext(config)
cac, auditlogger, dbMap := setupContext(c)
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
defer auditlogger.AuditPanic()
blog.SetAuditLogger(auditlogger)
@ -185,9 +185,6 @@ func main() {
Name: "reg-revoke",
Usage: "Revoke all certificates associated with a registration ID",
Action: func(c *cli.Context) {
config, err := loadConfig(c)
cmd.FailOnError(err, "Failed to load Boulder configuration")
// 1: registration ID, 2: reasonCode (3: deny flag)
regID, err := strconv.Atoi(c.Args().First())
cmd.FailOnError(err, "Registration ID argument must be a integer")
@ -195,7 +192,7 @@ func main() {
cmd.FailOnError(err, "Reason code argument must be a integer")
deny := c.GlobalBool("deny")
cac, auditlogger, dbMap := setupContext(config)
cac, auditlogger, dbMap := setupContext(c)
// AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3
defer auditlogger.AuditPanic()
blog.SetAuditLogger(auditlogger)

View File

@ -190,7 +190,6 @@ func (ssa *SQLStorageAuthority) InitTables() (err error) {
ssa.dbMap.AddTableWithName(core.CertificateStatus{}, "certificateStatus").SetKeys(false, "Serial").SetVersionCol("LockCol")
ssa.dbMap.AddTableWithName(core.OcspResponse{}, "ocspResponses").SetKeys(true, "ID")
ssa.dbMap.AddTableWithName(core.Crl{}, "crls").SetKeys(false, "Serial")
// ssa.dbMap.AddTableWithName(core.DeniedCsr{}, "deniedCsrs").SetKeys(true, "ID").ColMap("Names").SetUnique(true)
err = ssa.dbMap.CreateTablesIfNotExists()
return
@ -688,25 +687,6 @@ func (ssa *SQLStorageAuthority) AddCertificate(certDER []byte, regID int64) (dig
return
}
// func (ssa *SQLStorageAuthority) AddDeniedCSR(names []string) (err error) {
// sort.Strings(names)
// deniedCSR := &core.DeniedCsr{Names: strings.ToLower(strings.Join(names, ","))}
// tx, err := ssa.dbMap.Begin()
// if err != nil {
// return
// }
// err = tx.Insert(deniedCSR)
// if err != nil {
// tx.Rollback()
// return
// }
// err = tx.Commit()
// return
// }
func (ssa *SQLStorageAuthority) AlreadyDeniedCSR(names []string) (already bool, err error) {
sort.Strings(names)