Add logging in major failure paths in API calls

If we're at the point where we've found a major problem and think that
we need to reset the switches, actually write an error message to the
log first...

Change-Id: I1eed6691dd4331c6ced95ace80ffbf4a4f938417
diff --git a/util.py b/util.py
index 097bfa9..1f25f6b 100644
--- a/util.py
+++ b/util.py
@@ -266,6 +266,7 @@
             # failed. To undo the changes safely, we'll need to reset
             # all the switches we managed to configure. This could
             # take some time!
+            logging.error('create_vlan failed, resetting all switches to recover')
             for switch_name in switches_done:
                 s = self.get_switch_driver(switch_name, config)
                 s.switch_connect(config.switches[switch_name].username,
@@ -375,6 +376,7 @@
             # failed. To undo the changes safely, we'll need to reset
             # all the switches we managed to configure. This could
             # take some time!
+            logging.error('delete_vlan failed, resetting all switches to recover')
             for switch_name in switches_done:
                 s = self.get_switch_driver(switch_name, config)
                 s.switch_connect(config.switches[switch_name].username,
@@ -484,6 +486,7 @@
                         s.port_add_trunk_to_vlan(port.name, vlan.tag)
 
         except IOError:
+            logging.error('set_port_mode failed, resetting switch to recover')
             # Bugger. Looks like one of the switch calls above
             # failed. To undo the changes safely, we'll need to reset
             # all the config on this switch
@@ -543,6 +546,7 @@
         try:
             s.port_set_access_vlan(port.name, vlan.tag)
         except IOError:
+            logging.error('set_current_vlan failed, resetting switch to recover')
             # Bugger. Looks like one of the switch calls above
             # failed. To undo the changes safely, we'll need to reset
             # all the config on this switch
@@ -605,6 +609,7 @@
         try:
             s.port_set_access_vlan(port.name, vlan.tag)
         except IOError:
+            logging.error('restore_base_vlan failed, resetting switch to recover')
             # Bugger. Looks like one of the switch calls above
             # failed. To undo the changes safely, we'll need to reset
             # all the config on this switch