1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Replace aliased imports of logrus, fixes #11762

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca 2015-03-26 23:22:04 +01:00
parent 42f9594fd3
commit 6f4d847046
82 changed files with 597 additions and 597 deletions

View file

@ -4,7 +4,7 @@ import (
"fmt"
"time"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/engine"
"github.com/docker/libtrust"
)
@ -56,7 +56,7 @@ func (t *TrustStore) CmdCheckKey(job *engine.Job) error {
return fmt.Errorf("Error verifying key to namespace: %s", namespace)
}
if !verified {
log.Debugf("Verification failed for %s using key %s", namespace, pk.KeyID())
logrus.Debugf("Verification failed for %s using key %s", namespace, pk.KeyID())
job.Stdout.Write([]byte("not verified"))
} else if t.expiration.Before(time.Now()) {
job.Stdout.Write([]byte("expired"))

View file

@ -12,7 +12,7 @@ import (
"sync"
"time"
log "github.com/Sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/docker/libtrust/trustgraph"
)
@ -93,7 +93,7 @@ func (t *TrustStore) reload() error {
}
if len(statements) == 0 {
if t.autofetch {
log.Debugf("No grants, fetching")
logrus.Debugf("No grants, fetching")
t.fetcher = time.AfterFunc(t.fetchTime, t.fetch)
}
return nil
@ -106,7 +106,7 @@ func (t *TrustStore) reload() error {
t.expiration = expiration
t.graph = trustgraph.NewMemoryGraph(grants)
log.Debugf("Reloaded graph with %d grants expiring at %s", len(grants), expiration)
logrus.Debugf("Reloaded graph with %d grants expiring at %s", len(grants), expiration)
if t.autofetch {
nextFetch := expiration.Sub(time.Now())
@ -161,28 +161,28 @@ func (t *TrustStore) fetch() {
for bg, ep := range t.baseEndpoints {
statement, err := t.fetchBaseGraph(ep)
if err != nil {
log.Infof("Trust graph fetch failed: %s", err)
logrus.Infof("Trust graph fetch failed: %s", err)
continue
}
b, err := statement.Bytes()
if err != nil {
log.Infof("Bad trust graph statement: %s", err)
logrus.Infof("Bad trust graph statement: %s", err)
continue
}
// TODO check if value differs
err = ioutil.WriteFile(path.Join(t.path, bg+".json"), b, 0600)
if err != nil {
log.Infof("Error writing trust graph statement: %s", err)
logrus.Infof("Error writing trust graph statement: %s", err)
}
fetchCount++
}
log.Debugf("Fetched %d base graphs at %s", fetchCount, time.Now())
logrus.Debugf("Fetched %d base graphs at %s", fetchCount, time.Now())
if fetchCount > 0 {
go func() {
err := t.reload()
if err != nil {
log.Infof("Reload of trust graph failed: %s", err)
logrus.Infof("Reload of trust graph failed: %s", err)
}
}()
t.fetchTime = defaultFetchtime