feature flag: Policy feature enabled config group

A new configuration group ``[policy_feature_enabled]`` has been added to
Patrole which will be responsible for collecting the feature flags to be
used for newly introduced policies or policies that were changed in a
backwards-incompatible way.

    * create_port_fixed_ips_ip_address_policy (Neutron)
    * update_port_fixed_ips_ip_address_policy (Neutron)
    * limits_extension_used_limits_policy (Cinder)
    * volume_extension_volume_actions_attach_policy (Cinder)
    * volume_extension_volume_actions_reserve_policy (Cinder)
    * volume_extension_volume_actions_unreserve_policy (Cinder)

These feature flags will be supported until Pike release cycle
is EOL.

The motivation behind these feature flags is [0] which adds
Pike/Queens gating to Patrole. However, in Queens, Neutron
and Cinder renamed or removed a few policies in a backwards-
incompatible way. These policies can be reviewed here: [1].

This PS requires another PS [2] in devstack's lib/tempest
because Patrole, being a branchless project and hosting the
Patrole devstack plugin itself, must fall back to Tempest's
devstack script to list out the backwards-incompatible
policies in Pike.

A documentation update will also come in a follow up with
information on these feature flags.

[0] I76c4a9b8737bf94f230ab141def652b054120f3b
[1] e.g. http://logs.openstack.org/51/547851/4/check/patrole-member-pike/139c534/job-output.txt.gz#_2018-03-22_21_46_08_392229
[2] I00bdeff9474c54d38b6d6844a041b305bec01ad8

Change-Id: Ia0d9847908a8e723446c16465d68cd7f622c04cc
diff --git a/patrole_tempest_plugin/config.py b/patrole_tempest_plugin/config.py
index 0077d19..5103888 100644
--- a/patrole_tempest_plugin/config.py
+++ b/patrole_tempest_plugin/config.py
@@ -94,6 +94,7 @@
 patrole_log_group = cfg.OptGroup(
     name='patrole_log', title='Patrole Logging Options')
 
+
 PatroleLogGroup = [
     cfg.BoolOpt('enable_reporting',
                 default=False,
@@ -112,6 +113,47 @@
 ]
 
 
+policy_feature_enabled = cfg.OptGroup(
+    name='policy-feature-enabled',
+    title='Feature Flags for New or Changed Policies')
+
+
+PolicyFeatureEnabledGroup = [
+    # TODO(felipemonteiro): The 6 feature flags below should be removed after
+    # Pike is EOL.
+    cfg.BoolOpt('create_port_fixed_ips_ip_address_policy',
+                default=True,
+                help="""Is the Neutron policy
+"create_port:fixed_ips:ip_address" available in the cloud? This policy was
+changed in a backwards-incompatible way."""),
+    cfg.BoolOpt('update_port_fixed_ips_ip_address_policy',
+                default=True,
+                help="""Is the Neutron policy
+"update_port:fixed_ips:ip_address" available in the cloud? This policy was
+changed in a backwards-incompatible way."""),
+    cfg.BoolOpt('limits_extension_used_limits_policy',
+                default=True,
+                help="""Is the Cinder policy
+"limits_extension:used_limits" available in the cloud? This policy was
+changed in a backwards-incompatible way."""),
+    cfg.BoolOpt('volume_extension_volume_actions_attach_policy',
+                default=True,
+                help="""Is the Cinder policy
+"volume_extension:volume_actions:attach" available in the cloud? This policy
+was changed in a backwards-incompatible way."""),
+    cfg.BoolOpt('volume_extension_volume_actions_reserve_policy',
+                default=True,
+                help="""Is the Cinder policy
+"volume_extension:volume_actions:reserve" available in the cloud? This policy
+was changed in a backwards-incompatible way."""),
+    cfg.BoolOpt('volume_extension_volume_actions_unreserve_policy',
+                default=True,
+                help="""Is the Cinder policy
+"volume_extension:volume_actions:unreserve" available in the cloud? This policy
+was changed in a backwards-incompatible way.""")
+]
+
+
 def list_opts():
     """Return a list of oslo.config options available.
 
@@ -120,7 +162,9 @@
     """
     opt_list = [
         (patrole_group, PatroleGroup),
-        (patrole_log_group, PatroleLogGroup)
+        (patrole_log_group, PatroleLogGroup),
+        (policy_feature_enabled, PolicyFeatureEnabledGroup)
+
     ]
 
     return opt_list