GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add Python flake8 linting for W291 trailing whitespace with Super-Lin… · DIMSI-IS/cloudstack@182899d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github
    • linters
      • .flake8
    • workflows
      • linter.yml
  • cloud-cli
    • cloudapis
      • __init__.py
    • cloudtool
      • __init__.py
      • utils.py
  • plugins
    • hypervisors
      • baremetal/src/main/resources/security_group_agent/security_group_agent
        • cs_sg_agent.py
        • sglib.py
        • xmlobject.py
      • ovm/src/main/scripts/vm/hypervisor/ovm
        • ConfigFileOps.py
        • OvmCommonModule.py
        • OvmDiskModule.py
        • OvmDispatcher.py
        • OvmFaultConstants.py
        • OvmHaHeartBeatModule.py
        • OvmHostModule.py
        • OvmLoggerModule.py
        • OvmNetworkModule.py
        • OvmOCFS2Module.py
        • OvmObjectModule.py
        • OvmSecurityGroupModule.py
        • OvmStoragePoolModule.py
        • OvmVifModule.py
        • OvmVmModule.py
        • OvmVolumeModule.py
    • network-elements/stratosphere-ssp/sspmock
      • sspmock.py
  • python
    • bindir
      • cloud-external-ipallocator.py
    • incubation
      • cloud-web-ipallocator.py
    • lib/cloudutils
      • __init__.py
      • cloudException.py
      • configFileOps.py
      • networkConfig.py
  • scripts
    • network
      • exdhcp
        • dhcpd_edithosts.py
      • ping
        • baremetal_user_data.py
        • prepare_kickstart_bootfile.py
        • prepare_kickstart_kernel_initrd.py
        • prepare_tftp_bootfile.py
    • util
      • ipmi.py
      • macgen.py
    • vm
      • hypervisor
        • vmware
          • discover_networks.py
        • xenserver
          • cloudstack_pluginlib.py
          • mockxcpplugin.py
          • ovs-vif-flows.py
          • perfmon.py
          • xcposs
            • NFSSR.py
          • xcpserver
            • NFSSR.py
          • xenserver56fp1
            • NFSSR.py
          • xenserver56
            • InterfaceReconfigure.py
            • NFSSR.py
          • xenserver60
            • NFSSR.py
      • network/vnet
        • cloudstack_pluginlib.py
        • ovstunnel.py
  • test
    • integration
      • __init__.py
      • broken
        • maint
          • test_escalation_templates.py
          • test_vpc_host_maintenance.py
        • misc
          • test_vm_sync.py
        • test_vpn_service.py
      • component
        • __init__.py
        • maint
          • test_egress_rules_host_maintenance.py
          • test_ip_resource_count_for_vpc.py
          • testpath_vMotion_vmware.py
        • test_acl_isolatednetwork.py
        • test_acl_isolatednetwork_delete.py
        • test_acl_listsnapshot.py
        • test_acl_listvm.py
        • test_acl_listvolume.py
        • test_acl_sharednetwork.py
        • test_acl_sharednetwork_deployVM-impersonation.py
        • test_affinity_groups.py
        • test_affinity_groups_projects.py
        • test_allocation_states.py
        • test_asa1000v_fw.py
        • test_assign_vm.py
        • test_baremetal.py
        • test_blocker_bugs.py
        • test_browse_templates.py
        • test_browse_volumes.py
        • test_host.py
        • test_interop_xd_ccp.py
        • test_netscaler_configs.py
        • test_netscaler_lb_algo.py
        • test_non_contiguous_vlan.py
        • test_organization_states.py
        • test_project_configs.py
        • test_project_limits.py
        • test_project_usage.py
        • test_redundant_router_services.py
        • test_secsr_mount.py
        • test_stopped_vm.py
        • test_tags.py
        • test_updateResourceCount.py
        • test_volume_destroy_recover.py
        • test_vpc_network_lbrules.py
        • test_vpc_network_staticnatrule.py
        • test_vpc_vm_life_cycle.py
      • plugins
        • datera
          • TestVolumes.py
        • test_quota.py
      • smoke
        • __init__.py
        • test_affinity_groups.py
        • test_affinity_groups_projects.py
        • test_backup_recovery_dummy.py
        • test_create_list_domain_account_project.py
        • test_deploy_vgpu_enabled_vm.py
        • test_deploy_vm_with_userdata.py
        • test_guest_vlan_range.py
        • test_list_ids_parameter.py
        • test_loadbalance.py
        • test_nested_virtualization.py
        • test_password_server.py
        • test_public_ip_range.py
        • test_reset_vm_on_reboot.py
        • test_resource_detail.py
        • test_router_dnsservice.py
        • test_routers_iptables_default_policy.py
        • test_routers_network_ops.py
        • test_snapshots.py
        • test_ssvm.py
        • test_vpc_redundant.py
        • test_vpc_router_nics.py
      • testpaths
        • __init__.py
        • testpath_attach_disk_zwps.py
        • testpath_netmask.py
        • testpath_revert_snap.py
        • testpath_volume_recurring_snap.py
        • testpath_volume_snapshot.py
    • selenium
      • common
        • shared.py
      • lib
        • Global_Locators.py
        • initialize.py
      • smoke
        • Login_and_Accounts.py
        • Service_Offering.py
        • TemplatesAndISO.py
        • VM_lifeCycle.py
        • main.py
    • systemvm
      • test_update_config.py
  • tools
    • bugs-wiki
      • search-bugs.py
      • search-wiki.py
    • devcloud-kvm
      • devcloud-kvm.py
    • marvin/marvin
      • deployDataCenter.py
      • lib
        • __init__.py
        • ncc.py
        • utils.py
        • vcenter.py
      • misc/build
        • advanced_env.py
        • bashUtils.py
        • buildGenerator.py
        • configure.py
        • restartMgmt.py
        • testSetupSuccess.py
        • xunitmp
          • setup.py
          • xunitmultiprocess.py
      • sandbox
        • __init__.py
        • advancedsg
          • __init__.py
          • advancedsg_env.py
        • advanced
          • __init__.py
          • advanced_env.py
        • basic
          • __init__.py
          • basic_env.py
        • demo
          • __init__.py
          • live
            • __init__.py
            • testSshDeployVM.py
          • simulator
            • __init__.py
            • simulator_setup.py
            • testcase
              • __init__.py
              • libs
                • __init__.py
                • base.py
                • common.py
                • utils.py
              • test_vm_life_cycle.py
        • testSetupSuccess.py

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/linters/.flake8‎

Copy file name to clipboard
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[flake8]
19+
select = W291
Collapse file

‎.github/workflows/linter.yml‎

Copy file name to clipboard
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Lint Code Base
19+
20+
on: [pull_request]
21+
22+
jobs:
23+
build:
24+
name: GitHub Super Linter
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: github/super-linter@v4
29+
env:
30+
VALIDATE_PYTHON_FLAKE8: true
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Collapse file

‎cloud-cli/cloudapis/__init__.py‎

Copy file name to clipboardExpand all lines: cloud-cli/cloudapis/__init__.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
18+
1919

2020
'''
2121
Created on Aug 2, 2010
Collapse file

‎cloud-cli/cloudtool/__init__.py‎

Copy file name to clipboardExpand all lines: cloud-cli/cloudtool/__init__.py
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
18+
1919

2020
'''
2121
Created on Aug 2, 2010
@@ -26,16 +26,16 @@
2626
import cloudapis as apis
2727
import cloudtool.utils as utils
2828

29-
29+
3030
def main(argv=None):
31-
31+
3232
#import ipdb; ipdb.set_trace()
3333
if argv == None:
3434
argv = sys.argv
3535

3636
prelim_args = [ x for x in argv[0:] if not x.startswith('-') ]
3737
parser = utils.get_parser()
38-
38+
3939
api = __import__("cloudapis")
4040
apis = getattr(api, "implementor")
4141
if len(prelim_args) == 1:
@@ -44,20 +44,20 @@ def main(argv=None):
4444

4545
command = utils.lookup_command_in_api(apis,prelim_args[1])
4646
if not command: parser.error("command %r not supported by the %s API"%(prelim_args[1],prelim_args[0]))
47-
48-
argv = argv[1:]
47+
48+
argv = argv[1:]
4949
if len(argv) == 1:
5050
argv.append("--help")
5151

5252
parser = utils.get_parser(apis.__init__,command)
5353
opts,args,api_optionsdict,cmd_optionsdict = parser.parse_args(argv)
54-
55-
54+
55+
5656
try:
5757
api = apis(**api_optionsdict)
5858
except utils.OptParseError as e:
5959
parser.error(str(e))
60-
60+
6161
command = utils.lookup_command_in_api(api,args[0])
6262

6363
# we now discard the first two arguments as those necessarily are the api and command names
Collapse file

‎cloud-cli/cloudtool/utils.py‎

Copy file name to clipboardExpand all lines: cloud-cli/cloudtool/utils.py
+19-19Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
# to you under the Apache License, Version 2.0 (the
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
8-
#
8+
#
99
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
10+
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
18+
1919

2020
'''
2121
Created on Aug 2, 2010
@@ -48,28 +48,28 @@ def error(self, msg):
4848
error("%s: %s\n" % (self.get_prog_name(),msg))
4949
self.print_usage(sys.stderr)
5050
self.exit(os.EX_USAGE)
51-
51+
5252
def parse_args(self,*args,**kwargs):
5353
options,arguments = OptionParser.parse_args(self,*args,**kwargs)
54-
54+
5555
def prune_options(options,alist):
5656
"""Given 'options' -- a list of arguments to OptionParser.add_option,
5757
and a set of optparse Values, return a dictionary of only those values
5858
that apply exclusively to 'options'"""
5959
return dict( [ (k,getattr(options,k)) for k in dir(options) if k in alist ] )
60-
60+
6161
api_options = prune_options(options,self.api_dests)
6262
cmd_options = prune_options(options,self.cmd_dests)
63-
63+
6464
return options,arguments,api_options,cmd_options
6565

6666

6767
def get_parser(api_callable=None,cmd_callable=None): # this should probably be the __init__ method of myoptionparser
68-
68+
6969
def getdefaulttag(default):
7070
if default is not None: return " [Default: %default]"
7171
return ''
72-
72+
7373
def get_arguments_and_options(callable):
7474
"""Infers and returns arguments and options based on a callable's signature.
7575
Cooperates with decorator @describe"""
@@ -96,37 +96,37 @@ def get_arguments_and_options(callable):
9696
return arguments,options
9797

9898
basic_usage = "usage: %prog [options...] "
99-
99+
100100
api_name = "<api>"
101101
cmd_name = "<command>"
102102
description = "%prog is a command-line tool to access several cloud APIs."
103103
arguments = ''
104104
argexp = ""
105-
105+
106106
if api_callable:
107107
api_name = api_callable.__module__.split(".")[-1].replace("_","-")
108108
api_arguments,api_options = get_arguments_and_options(api_callable)
109109
assert len(api_arguments) is 0 # no mandatory arguments for class initializers
110-
110+
111111
if cmd_callable:
112112
cmd_name = cmd_callable.__name__.replace("_","-")
113113
cmd_arguments,cmd_options = get_arguments_and_options(cmd_callable)
114114
if cmd_arguments:
115115
arguments = " " + " ".join( [ s[0].upper() for s in cmd_arguments ] )
116116
argexp = "\n\nArguments:\n" + "\n".join ( " %s\n %s"%(s.upper(),u) for s,u in cmd_arguments )
117117
description = cmd_callable.__doc__
118-
118+
119119
api_command = "%s %s"%(api_name,cmd_name)
120120

121121
if description: description = "\n\n" + description
122122
else: description = ''
123-
123+
124124
usage = basic_usage + api_command + arguments + description + argexp
125125

126126
parser = MyOptionParser(usage=usage, add_help_option=False)
127-
127+
128128
parser.add_option('--help', action="help")
129-
129+
130130
group = parser.add_option_group("General options")
131131
group.add_option('-v', '--verbose', dest="verbose", help="Print extra output")
132132

@@ -136,14 +136,14 @@ def get_arguments_and_options(callable):
136136
for a in api_options:
137137
group.add_option(a[0][0],**a[1])
138138
parser.api_dests.append(a[1]["dest"])
139-
139+
140140
parser.cmd_dests = []
141141
if cmd_callable and cmd_options:
142142
group = parser.add_option_group("Options for the %s command"%cmd_name)
143143
for a in cmd_options:
144144
group.add_option(a[0][0],**a[1])
145145
parser.cmd_dests.append(a[1]["dest"])
146-
146+
147147
return parser
148148

149149
def lookup_command_in_api(api,command_name):
@@ -155,7 +155,7 @@ def get_api_list(api):
155155
for cmd_name in dir(api):
156156
cmd = getattr(api,cmd_name)
157157
if callable(cmd) and not cmd_name.startswith("_"):
158-
apilist.append(cmd_name)
158+
apilist.append(cmd_name)
159159
return apilist
160160

161161
def get_command_list(api):

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.