예제 #1
0
 def _report_ready(self, lease):
     """Tells the fabric provisioning has completed """
     try:
         get_metadata_from_fabric(None, lease['unknown-245'])
     except Exception:
         LOG.warning(
             "Error communicating with Azure fabric; You may experience."
             "connectivity issues.", exc_info=True)
예제 #2
0
 def test_calls_shim_register_with_azure_and_fetch_data(self, shim):
     m_pubkey_info = mock.MagicMock()
     azure_helper.get_metadata_from_fabric(pubkey_info=m_pubkey_info)
     self.assertEqual(
         1, shim.return_value.register_with_azure_and_fetch_data.call_count)
     self.assertEqual(
         mock.call(pubkey_info=m_pubkey_info),
         shim.return_value.register_with_azure_and_fetch_data.call_args)
예제 #3
0
 def test_instantiates_shim_with_kwargs(self, shim):
     m_fallback_lease_file = mock.MagicMock()
     m_dhcp_options = mock.MagicMock()
     azure_helper.get_metadata_from_fabric(
         fallback_lease_file=m_fallback_lease_file,
         dhcp_opts=m_dhcp_options)
     self.assertEqual(1, shim.call_count)
     self.assertEqual(
         mock.call(fallback_lease_file=m_fallback_lease_file,
                   dhcp_options=m_dhcp_options), shim.call_args)
 def test_success_calls_clean_up(self, shim):
     azure_helper.get_metadata_from_fabric()
     self.assertEqual(1, shim.return_value.clean_up.call_count)
 def test_data_from_shim_returned(self, shim):
     ret = azure_helper.get_metadata_from_fabric()
     self.assertEqual(
         shim.return_value.register_with_azure_and_fetch_data.return_value,
         ret)
 def test_success_calls_clean_up(self, shim):
     azure_helper.get_metadata_from_fabric()
     self.assertEqual(1, shim.return_value.clean_up.call_count)
 def test_data_from_shim_returned(self, shim):
     ret = azure_helper.get_metadata_from_fabric()
     self.assertEqual(
         shim.return_value.register_with_azure_and_fetch_data.return_value,
         ret)