Add skip if public_network_id is not specified

If public_network_id is not specified in tempest.conf,
the testcases using it should be skipped, otherwize we will
get errors like:
    BadRequest: Bad request
    Details: {u'message': u"Invalid input for external_gateway_info.
              Reason: '' is not a valid UUID.",
              u'type': u'HTTPBadRequest', u'detail': u''}

Besides, _create_router in dynamic_creds will try to create_router
using self.public_network_id as external_gateway_info, which will also
raise Error when self.public_network_id is None, so here is to pass
external_gateway_info to create_router only when self.public_network_id
is not None.

Change-Id: I567f9a51d301bcfea782d549298dbd3a598f3b85
diff --git a/tempest/scenario/test_snapshot_pattern.py b/tempest/scenario/test_snapshot_pattern.py
index 2ce8532..6dedd1d 100644
--- a/tempest/scenario/test_snapshot_pattern.py
+++ b/tempest/scenario/test_snapshot_pattern.py
@@ -13,6 +13,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import testtools
+
 from tempest import config
 from tempest.lib import decorators
 from tempest.scenario import manager
@@ -39,6 +41,8 @@
             raise cls.skipException("Snapshotting is not available.")
 
     @decorators.idempotent_id('608e604b-1d63-4a82-8e3e-91bc665c90b4')
+    @testtools.skipUnless(CONF.network.public_network_id,
+                          'The public_network_id option must be specified.')
     @test.services('compute', 'network', 'image')
     def test_snapshot_pattern(self):
         # prepare for booting an instance