Move to hacking 0.10

Release notes:
http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0

Per the release notes, H307, H803 and H904 has been removed.

Fix code issues with H238 and W292.

Change-Id: I747ebb64db5825bc70f1ae19c1c1f5ca2089c06d
This commit is contained in:
lin-hua-cheng
2015-02-04 18:56:23 -08:00
parent 59c57a16f0
commit 0cde6aa055
101 changed files with 196 additions and 199 deletions

View File

@@ -137,7 +137,7 @@ class HostAggregatesTable(tables.DataTable):
wrap_list=True,
filters=(safe_unordered_list,))
class Meta:
class Meta(object):
name = "host_aggregates"
hidden_title = False
verbose_name = _("Host Aggregates")
@@ -165,7 +165,7 @@ class AvailabilityZonesTable(tables.DataTable):
def get_object_id(self, zone):
return zone.zoneName
class Meta:
class Meta(object):
name = "availability_zones"
hidden_title = False
verbose_name = _("Availability Zones")

View File

@@ -27,7 +27,7 @@ class SetAggregateInfoAction(workflows.Action):
availability_zone = forms.CharField(label=_("Availability Zone"),
max_length=255)
class Meta:
class Meta(object):
name = _("Host Aggregate Information")
help_text = _("Host aggregates divide an availability zone into "
"logical units by grouping together hosts. Create a "
@@ -90,7 +90,7 @@ class AddHostsToAggregateAction(workflows.MembershipAction):
self.fields[field_name].choices = \
[(host_name, host_name) for host_name in host_names]
class Meta:
class Meta(object):
name = _("Manage Hosts within Aggregate")
slug = "add_host_to_aggregate"
@@ -130,7 +130,7 @@ class ManageAggregateHostsAction(workflows.MembershipAction):
self.fields[field_name].initial = current_aggregate_hosts
class Meta:
class Meta(object):
name = _("Manage Hosts within Aggregate")

View File

@@ -70,7 +70,7 @@ class QuotasTable(tables.DataTable):
def get_object_id(self, obj):
return obj.name
class Meta:
class Meta(object):
name = "quotas"
verbose_name = _("Quotas")
table_actions = (QuotaFilterAction, UpdateDefaultQuotas)

View File

@@ -63,7 +63,7 @@ class UpdateDefaultQuotasAction(workflows.Action):
self.fields[field].required = False
self.fields[field].widget = forms.HiddenInput()
class Meta:
class Meta(object):
name = _("Default Quotas")
slug = 'update_default_quotas'
help_text = _("From here you can update the default quotas "

View File

@@ -145,7 +145,7 @@ class FlavorsTable(tables.DataTable):
empty_value=False,
filters=(filters.yesno, filters.capfirst))
class Meta:
class Meta(object):
name = "flavors"
verbose_name = _("Flavors")
table_actions = (FlavorFilterAction, CreateFlavor, DeleteFlavor)

View File

@@ -54,7 +54,7 @@ class CreateFlavorInfoAction(workflows.Action):
swap_mb = forms.IntegerField(label=_("Swap Disk (MB)"),
min_value=0)
class Meta:
class Meta(object):
name = _("Flavor Information")
help_text = _("Flavors define the sizes for RAM, disk, number of "
"cores, and other resources and can be selected when "
@@ -147,7 +147,7 @@ class UpdateFlavorAccessAction(workflows.MembershipAction):
self.fields[field_name].initial = flavor_access
class Meta:
class Meta(object):
name = _("Flavor Access")
slug = "update_flavor_access"
@@ -222,7 +222,7 @@ class CreateFlavor(workflows.Workflow):
class UpdateFlavorInfoAction(CreateFlavorInfoAction):
flavor_id = forms.CharField(widget=forms.widgets.HiddenInput)
class Meta:
class Meta(object):
name = _("Flavor Information")
slug = 'update_info'
help_text = _("Edit the flavor details. Flavors define the sizes for "

View File

@@ -106,7 +106,7 @@ class ComputeHostTable(tables.DataTable):
def get_object_display(self, obj):
return obj.host
class Meta:
class Meta(object):
name = "compute_host"
verbose_name = _("Compute Host")
table_actions = (ComputeHostFilterAction,)

View File

@@ -59,7 +59,7 @@ class AdminHypervisorsTable(tables.DataTable):
def get_object_id(self, hypervisor):
return hypervisor.hypervisor_hostname
class Meta:
class Meta(object):
name = "hypervisors"
verbose_name = _("Hypervisors")
@@ -75,6 +75,6 @@ class AdminHypervisorInstancesTable(tables.DataTable):
def get_object_id(self, server):
return server['uuid']
class Meta:
class Meta(object):
name = "hypervisor_instances"
verbose_name = _("Hypervisor Instances")

View File

@@ -70,7 +70,7 @@ class AdminImagesTable(project_tables.ImagesTable):
link="horizon:admin:images:detail",
verbose_name=_("Image Name"))
class Meta:
class Meta(object):
name = "images"
row_class = UpdateRow
status_columns = ["status"]

View File

@@ -64,7 +64,7 @@ class ServicesTable(tables.DataTable):
status=True,
display_choices=SERVICE_STATUS_DISPLAY_CHOICES)
class Meta:
class Meta(object):
name = "services"
verbose_name = _("Services")
table_actions = (ServiceFilterAction,)
@@ -102,7 +102,7 @@ class NovaServicesTable(tables.DataTable):
def get_object_id(self, obj):
return "%s-%s-%s" % (obj.binary, obj.host, obj.zone)
class Meta:
class Meta(object):
name = "nova_services"
verbose_name = _("Compute Services")
table_actions = (SubServiceFilterAction,)
@@ -127,7 +127,7 @@ class CinderServicesTable(tables.DataTable):
def get_object_id(self, obj):
return "%s-%s-%s" % (obj.binary, obj.host, obj.zone)
class Meta:
class Meta(object):
name = "cinder_services"
verbose_name = _("Block Storage Services")
table_actions = (SubServiceFilterAction,)
@@ -176,7 +176,7 @@ class NetworkAgentsTable(tables.DataTable):
def get_object_id(self, obj):
return "%s-%s" % (obj.binary, obj.host)
class Meta:
class Meta(object):
name = "network_agents"
verbose_name = _("Network Agents")
table_actions = (NetworkAgentsFilterAction,)

View File

@@ -159,7 +159,7 @@ class AdminInstancesTable(tables.DataTable):
filters.timesince_sortable),
attrs={'data-type': 'timesince'})
class Meta:
class Meta(object):
name = "instances"
verbose_name = _("Instances")
status_columns = ["status", "task"]

View File

@@ -28,4 +28,4 @@ class MetadataDefinitions(horizon.Panel):
if glance.VERSIONS.active >= 2:
dashboard.Admin.register(MetadataDefinitions)
dashboard.Admin.register(MetadataDefinitions)

View File

@@ -160,7 +160,7 @@ class AdminNamespacesTable(tables.DataTable):
return datum.display_name
return None
class Meta:
class Meta(object):
name = "namespaces"
verbose_name = _("Namespaces")
row_class = UpdateRow

View File

@@ -51,7 +51,7 @@ class ReportTable(tables.DataTable):
def get_object_id(self, obj):
return "%s-%s-%s" % (obj['project'], obj['service'], obj['meter'])
class Meta:
class Meta(object):
name = 'report_table'
verbose_name = _("Daily Usage Report")
table_actions = (ModifyUsageReportParameters, CreateCSVUsageReport)
@@ -86,5 +86,5 @@ class UsageTable(tables.DataTable):
def __unicode__(self):
return self.title
class Meta:
class Meta(object):
name = 'daily'

View File

@@ -96,7 +96,7 @@ class DHCPAgentsTable(tables.DataTable):
filters=(utils_filters.parse_isotime,
filters.timesince))
class Meta:
class Meta(object):
name = "agents"
verbose_name = _("DHCP Agents")
table_actions = (AddDHCPAgent, DeleteDHCPAgent)

View File

@@ -104,7 +104,7 @@ class PortsTable(tables.DataTable):
mac_state = tables.Column("mac_state", empty_value=api.neutron.OFF_STATE,
verbose_name=_("Mac Learning State"))
class Meta:
class Meta(object):
name = "ports"
verbose_name = _("Ports")
table_actions = (CreatePort, DeletePort)

View File

@@ -111,7 +111,7 @@ class SubnetsTable(tables.DataTable):
exceptions.handle(self.request, msg, redirect=self.failure_url)
return network
class Meta:
class Meta(object):
name = "subnets"
verbose_name = _("Subnets")
table_actions = (CreateSubnet, DeleteSubnet)

View File

@@ -104,7 +104,7 @@ class NetworksTable(tables.DataTable):
verbose_name=_("Admin State"),
display_choices=DISPLAY_CHOICES)
class Meta:
class Meta(object):
name = "networks"
verbose_name = _("Networks")
table_actions = (CreateNetwork, DeleteNetwork,

View File

@@ -24,6 +24,6 @@ class RouterRulesTable(tables.DataTable):
action = tables.Column("action", verbose_name=_("Action"))
nexthops = tables.Column("nexthops", verbose_name=_("Next Hops"))
class Meta:
class Meta(object):
name = "routerrules"
verbose_name = _("Router Rules")

View File

@@ -44,6 +44,6 @@ class PortsTable(tables.DataTable):
def get_object_display(self, port):
return port.id
class Meta:
class Meta(object):
name = "interfaces"
verbose_name = _("Interfaces")

View File

@@ -41,7 +41,7 @@ class RoutersTable(r_tables.RoutersTable):
verbose_name=_("Name"),
link="horizon:admin:routers:detail")
class Meta:
class Meta(object):
name = "Routers"
verbose_name = _("Routers")
status_columns = ["status"]

View File

@@ -64,7 +64,7 @@ class VolumeSnapshotsTable(volumes_tables.VolumesTableBase):
host = tables.Column("host_name", verbose_name=_("Host"))
tenant = tables.Column("tenant_name", verbose_name=_("Project"))
class Meta:
class Meta(object):
name = "volume_snapshots"
verbose_name = _("Volume Snapshots")
table_actions = (snapshots_tables.VolumeSnapshotsFilterAction,

View File

@@ -69,7 +69,7 @@ class ExtraSpecsTable(tables.DataTable):
key = tables.Column('key', verbose_name=_('Key'))
value = tables.Column('value', verbose_name=_('Value'))
class Meta:
class Meta(object):
name = "extras"
verbose_name = _("Extra Specs")
table_actions = (ExtraSpecCreate, ExtraSpecDelete)

View File

@@ -67,4 +67,4 @@ class EditKeyValuePair(forms.SelfHandlingForm):
except Exception:
exceptions.handle(request,
_("Unable to edit spec."))
return False
return False

View File

@@ -58,7 +58,7 @@ class SpecsTable(tables.DataTable):
key = tables.Column('key', verbose_name=_('Key'))
value = tables.Column('value', verbose_name=_('Value'))
class Meta:
class Meta(object):
name = "specs"
verbose_name = _("Key-Value Pairs")
table_actions = (SpecCreateKeyValuePair, SpecDeleteKeyValuePair)

View File

@@ -157,7 +157,7 @@ class VolumeTypesTable(tables.DataTable):
def get_object_id(self, vol_type):
return str(vol_type.id)
class Meta:
class Meta(object):
name = "volume_types"
hidden_title = False
verbose_name = _("Volume Types")
@@ -239,7 +239,7 @@ class QosSpecsTable(tables.DataTable):
def get_object_id(self, qos_specs):
return qos_specs.id
class Meta:
class Meta(object):
name = "qos_specs"
hidden_title = False
verbose_name = _("QoS Specs")

View File

@@ -81,7 +81,7 @@ class VolumesTable(volumes_tables.VolumesTable):
host = tables.Column("os-vol-host-attr:host", verbose_name=_("Host"))
tenant = tables.Column("tenant_name", verbose_name=_("Project"))
class Meta:
class Meta(object):
name = "volumes"
verbose_name = _("Volumes")
status_columns = ["status"]