OpenStack: Switch some Info log to Debug

Allow to use $(machine url) without having to pipe the
result due to too verbose Info logs.

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
This commit is contained in:
Vincent Giersch 2014-12-11 10:36:50 +01:00 committed by Guillaume Giamarchi
parent 59260f2716
commit 156e0acd32
2 changed files with 10 additions and 10 deletions

View File

@ -186,7 +186,7 @@ func (c *Client) getFloatingIPs(d *Driver) ([]string, error) {
return false, err return false, err
} }
for _, f := range floatingipList { for _, f := range floatingipList {
log.Info("### FloatingIP => %s", f) log.Debug("### FloatingIP => %s", f)
} }
return true, nil return true, nil
}) })
@ -213,7 +213,7 @@ func (c *Client) getPorts(d *Driver) ([]string, error) {
return false, err return false, err
} }
for _, port := range portList { for _, port := range portList {
log.Info("### Port => %s", port) log.Debug("### Port => %s", port)
} }
return true, nil return true, nil
}) })
@ -276,7 +276,7 @@ func (c *Client) Authenticate(d *Driver) error {
"Username": d.Username, "Username": d.Username,
"TenantName": d.TenantName, "TenantName": d.TenantName,
"TenantID": d.TenantId, "TenantID": d.TenantId,
}).Info("Authenticating...") }).Debug("Authenticating...")
opts := gophercloud.AuthOptions{ opts := gophercloud.AuthOptions{
IdentityEndpoint: d.AuthUrl, IdentityEndpoint: d.AuthUrl,

View File

@ -140,7 +140,7 @@ func RegisterCreateFlags(cmd *flag.FlagSet) interface{} {
func NewDriver(storePath string) (drivers.Driver, error) { func NewDriver(storePath string) (drivers.Driver, error) {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"storePath": storePath, "storePath": storePath,
}).Info("Instanciate OpenStack driver...") }).Debug("Instanciate OpenStack driver...")
return &Driver{ return &Driver{
storePath: storePath, storePath: storePath,
client: &Client{}, client: &Client{},
@ -223,7 +223,7 @@ func (d *Driver) GetIP() (string, error) {
func (d *Driver) GetState() (state.State, error) { func (d *Driver) GetState() (state.State, error) {
log.WithField("MachineId", d.MachineId).Info("Get status for OpenStack instance...") log.WithField("MachineId", d.MachineId).Debug("Get status for OpenStack instance...")
s, err := d.client.GetInstanceState(d) s, err := d.client.GetInstanceState(d)
if err != nil { if err != nil {
@ -233,7 +233,7 @@ func (d *Driver) GetState() (state.State, error) {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"MachineId": d.MachineId, "MachineId": d.MachineId,
"State": s, "State": s,
}).Info("State for OpenStack instance") }).Debug("State for OpenStack instance")
switch s { switch s {
case "ACTIVE": case "ACTIVE":
@ -366,12 +366,12 @@ func (d *Driver) foundIP(ip string) string {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"IP": ip, "IP": ip,
"MachineId": d.MachineId, "MachineId": d.MachineId,
}).Info("IP address found") }).Debug("IP address found")
return ip return ip
} }
func (d *Driver) createSSHKey() error { func (d *Driver) createSSHKey() error {
log.WithField("Name", d.KeyPairName).Info("Creating Key Pair...") log.WithField("Name", d.KeyPairName).Debug("Creating Key Pair...")
if err := ssh.GenerateSSHKey(d.sshKeyPath()); err != nil { if err := ssh.GenerateSSHKey(d.sshKeyPath()); err != nil {
return err return err
} }
@ -389,7 +389,7 @@ func (d *Driver) createMachine() error {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"FlavorId": d.FlavorId, "FlavorId": d.FlavorId,
"ImageId": d.ImageId, "ImageId": d.ImageId,
}).Info("Creating OpenStack instance...") }).Debug("Creating OpenStack instance...")
instanceId, err := d.client.CreateInstance(d) instanceId, err := d.client.CreateInstance(d)
if err != nil { if err != nil {
return err return err
@ -399,7 +399,7 @@ func (d *Driver) createMachine() error {
} }
func (d *Driver) waitForInstanceToStart() error { func (d *Driver) waitForInstanceToStart() error {
log.WithField("MachineId", d.MachineId).Info("Waiting for the OpenStack instance to start...") log.WithField("MachineId", d.MachineId).Debug("Waiting for the OpenStack instance to start...")
if err := d.client.WaitForInstanceStatus(d, "ACTIVE", 200); err != nil { if err := d.client.WaitForInstanceStatus(d, "ACTIVE", 200); err != nil {
return err return err
} }