Make all Python pass pyflakes

This found one bug, but will also help us with Jenkins testing of these scripts

Change-Id: Iabe171645c06f769957db7cf0def1d10a0e47988
This commit is contained in:
Andrew Hutchings 2012-05-25 14:26:41 +01:00
parent 3c660d675e
commit aae2f80fdd
10 changed files with 9 additions and 19 deletions

View File

@ -11,7 +11,7 @@
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # serve to show the default.
import sys, os, datetime import datetime
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the

View File

@ -29,7 +29,6 @@
import github2.client import github2.client
import os import os
import StringIO
import ConfigParser import ConfigParser
import logging import logging
import re import re

View File

@ -18,7 +18,6 @@
# 1. if open and no activity in 2 weeks, expire # 1. if open and no activity in 2 weeks, expire
# 2. if negative comment and no activity in 1 week, expire # 2. if negative comment and no activity in 1 week, expire
import os
import paramiko import paramiko
import json import json
import logging import logging

View File

@ -20,16 +20,13 @@
# remote = https://gerrit.googlesource.com/gerrit # remote = https://gerrit.googlesource.com/gerrit
import ConfigParser import ConfigParser
import StringIO
import logging import logging
import os import os
import re import re
import subprocess import subprocess
import shlex
def run_command(cmd, status=False, env={}): def run_command(cmd, status=False, env={}):
if VERBOSE:
print datetime.datetime.now(), "Running:", cmd
cmd_list = shlex.split(str(cmd)) cmd_list = shlex.split(str(cmd))
newenv = os.environ newenv = os.environ
newenv.update(env) newenv.update(env)

View File

@ -15,16 +15,10 @@
# Add launchpad ids listed in the wiki CLA page to the CLA group in LP. # Add launchpad ids listed in the wiki CLA page to the CLA group in LP.
import os
import sys
import uuid
import os import os
import urllib import urllib
import re import re
import StringIO
import ConfigParser
from launchpadlib.launchpad import Launchpad from launchpadlib.launchpad import Launchpad
from launchpadlib.uris import LPNET_SERVICE_ROOT from launchpadlib.uris import LPNET_SERVICE_ROOT

View File

@ -19,7 +19,6 @@ import os
import sys import sys
import fcntl import fcntl
import uuid import uuid
import os
import subprocess import subprocess
from datetime import datetime from datetime import datetime
@ -42,6 +41,9 @@ from openid.cryptutil import randomString
DEBUG = False DEBUG = False
# suppress pyflakes
pkg_resources.get_supported_platform()
pid_file = '/tmp/update_gerrit_users.pid' pid_file = '/tmp/update_gerrit_users.pid'
fp = open(pid_file, 'w') fp = open(pid_file, 'w')
try: try:

View File

@ -19,6 +19,7 @@
# 2. split out the two classes into separate files to be used as a library # 2. split out the two classes into separate files to be used as a library
import os import os
import sys
import ConfigParser import ConfigParser
import StringIO import StringIO
import paramiko import paramiko
@ -301,7 +302,7 @@ class GerritAction(object):
user_ssh_keys= ["%s %s %s" % ('ssh-%s' % key.keytype.lower(), key.keytext, key.comment) for key in user_data.sshkeys] user_ssh_keys= ["%s %s %s" % ('ssh-%s' % key.keytype.lower(), key.keytext, key.comment) for key in user_data.sshkeys]
user_email= None user_email= None
try: try:
email = user_data.preferred_email_address.email user_email = user_data.preferred_email_address.email
except ValueError: except ValueError:
pass pass
query= "insert into account_id (s) values (NULL)" query= "insert into account_id (s) values (NULL)"

View File

@ -19,10 +19,8 @@ import os
import argparse import argparse
import hashlib import hashlib
import yaml import yaml
import sys
import xml.etree.ElementTree as XML import xml.etree.ElementTree as XML
from xml.dom import minidom from xml.dom import minidom
import pycurl
import jenkins import jenkins
import ConfigParser import ConfigParser
from StringIO import StringIO from StringIO import StringIO

View File

@ -42,7 +42,7 @@ class publisher_tarball(object):
btrigger_config = XML.SubElement(btrigger_configs, 'hudson.plugins.parameterizedtrigger.BuildTriggerConfig') btrigger_config = XML.SubElement(btrigger_configs, 'hudson.plugins.parameterizedtrigger.BuildTriggerConfig')
configs = XML.SubElement(btrigger_config, 'configs') configs = XML.SubElement(btrigger_config, 'configs')
parameters = XML.SubElement(configs, 'hudson.plugins.parameterizedtrigger.PredefinedBuildParameters') parameters = XML.SubElement(configs, 'hudson.plugins.parameterizedtrigger.PredefinedBuildParameters')
properties = XML.SubElement(parameters, 'properties').text = 'BUILD_SELECTOR=<SpecificBuildSelector><buildNumber>$BUILD_NUMBER</buildNumber></SpecificBuildSelector>\n\ XML.SubElement(parameters, 'properties').text = 'BUILD_SELECTOR=<SpecificBuildSelector><buildNumber>$BUILD_NUMBER</buildNumber></SpecificBuildSelector>\n\
BRANCH=$GERRIT_REFNAME' BRANCH=$GERRIT_REFNAME'
XML.SubElement(btrigger_config, 'projects').text = '{proj}-ppa'.format(proj=self.data['main']['project']) XML.SubElement(btrigger_config, 'projects').text = '{proj}-ppa'.format(proj=self.data['main']['project'])
XML.SubElement(btrigger_config, 'condition').text = 'SUCCESS' XML.SubElement(btrigger_config, 'condition').text = 'SUCCESS'

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
import sys import sys
from subprocess import * from subprocess import Popen, PIPE
p = Popen(["ping", sys.argv[1]], stdout=PIPE) p = Popen(["ping", sys.argv[1]], stdout=PIPE)
while True: while True: