Skip to content

Commit

Permalink
resolved PEP8 issue E265
Browse files Browse the repository at this point in the history
block comment should start with '# '
  • Loading branch information
berendt committed May 30, 2014
1 parent d32e4af commit e383109
Show file tree
Hide file tree
Showing 24 changed files with 92 additions and 92 deletions.
6 changes: 3 additions & 3 deletions cobbler/action_hardlink.py
Expand Up @@ -31,9 +31,9 @@ def __init__(self, config, logger=None):
"""
Constructor
"""
#self.config = config
#self.api = config.api
#self.settings = config.settings()
# self.config = config
# self.api = config.api
# self.settings = config.settings()
if logger is None:
logger = clogger.Logger()
self.logger = logger
Expand Down
2 changes: 1 addition & 1 deletion cobbler/action_reposync.py
Expand Up @@ -479,7 +479,7 @@ def apt_sync(self, repo):
# NOTE: Dropping @@suite@@ replace as it is also dropped from
# from manage_import_debian_ubuntu.py due that repo has no os_version
# attribute. If it is added again it will break the Web UI!
#mirror = repo.mirror.replace("@@suite@@",repo.os_version)
# mirror = repo.mirror.replace("@@suite@@",repo.os_version)
mirror = repo.mirror

idx = mirror.find("://")
Expand Down
12 changes: 6 additions & 6 deletions cobbler/api.py
Expand Up @@ -898,8 +898,8 @@ def import_tree(self, mirror_url, mirror_name, network_root=None, kickstart_file
self.log("Network root given to --available-as is missing a colon, please see the manpage example.")
return False

#importer_modules = self.get_modules_in_category("manage/import")
#for importer_module in importer_modules:
# importer_modules = self.get_modules_in_category("manage/import")
# for importer_module in importer_modules:
# manager = importer_module.get_import_manager(self._config,logger)
# try:
# (found,pkgdir) = manager.check_for_signature(path,breed)
Expand All @@ -910,10 +910,10 @@ def import_tree(self, mirror_url, mirror_name, network_root=None, kickstart_file
# self.log("an exception occured while running the import manager")
# self.log("error was: %s" % sys.exc_info()[1])
# continue
#self.log("No import managers found a valid signature at the location specified")
## FIXME: since we failed, we should probably remove the
## path tree we created above so we don't leave cruft around
#return False
# self.log("No import managers found a valid signature at the location specified")
# # FIXME: since we failed, we should probably remove the
# # path tree we created above so we don't leave cruft around
# return False
import_module = self.get_module_by_name("manage_import_signatures").get_import_manager(self._config, logger)
return import_module.run(path, mirror_name, network_root, kickstart_file, arch, breed, os_version)

Expand Down
6 changes: 3 additions & 3 deletions cobbler/cli.py
Expand Up @@ -609,9 +609,9 @@ def follow_task(self, task_id):
# adapted from: http://code.activestate.com/recipes/157035/
file = open(logfile, 'r')
# Find the size of the file and move to the end
#st_results = os.stat(filename)
#st_size = st_results[6]
#file.seek(st_size)
# st_results = os.stat(filename)
# st_size = st_results[6]
# file.seek(st_size)

while 1:
where = file.tell()
Expand Down
2 changes: 1 addition & 1 deletion cobbler/collection_files.py
Expand Up @@ -26,7 +26,7 @@
from cexceptions import CX
from utils import _

#--------------------------------------------
# --------------------------------------------


class Files(collection.Collection):
Expand Down
2 changes: 1 addition & 1 deletion cobbler/collection_images.py
Expand Up @@ -20,7 +20,7 @@
from utils import _
import action_litesync

#--------------------------------------------
# --------------------------------------------


class Images(collection.Collection):
Expand Down
2 changes: 1 addition & 1 deletion cobbler/collection_mgmtclasses.py
Expand Up @@ -26,7 +26,7 @@
from cexceptions import CX
from utils import _

#--------------------------------------------
# --------------------------------------------


class Mgmtclasses(collection.Collection):
Expand Down
2 changes: 1 addition & 1 deletion cobbler/collection_packages.py
Expand Up @@ -26,7 +26,7 @@
from cexceptions import CX
from utils import _

#--------------------------------------------
# --------------------------------------------


class Packages(collection.Collection):
Expand Down
2 changes: 1 addition & 1 deletion cobbler/collection_profiles.py
Expand Up @@ -30,7 +30,7 @@
import action_litesync
from utils import _

#--------------------------------------------
# --------------------------------------------


class Profiles(collection.Collection):
Expand Down
4 changes: 2 additions & 2 deletions cobbler/collection_repos.py
Expand Up @@ -31,7 +31,7 @@

TESTMODE = False

#--------------------------------------------
# --------------------------------------------


class Repos(collection.Collection):
Expand Down Expand Up @@ -71,7 +71,7 @@ def remove(self, name, with_delete=True, with_sync=True, with_triggers=True, rec
utils.run_triggers(self.config.api, obj, "/var/lib/cobbler/triggers/delete/repo/post/*", [], logger)
utils.run_triggers(self.config.api, obj, "/var/lib/cobbler/triggers/change/*", [], logger)

#FIXME: better use config.settings() webdir?
# FIXME: better use config.settings() webdir?
path = "/var/www/cobbler/repo_mirror/%s" % obj.name
if os.path.exists("/srv/www/"):
path = "/srv/www/cobbler/repo_mirror/%s" % obj.name
Expand Down
2 changes: 1 addition & 1 deletion cobbler/collection_systems.py
Expand Up @@ -28,7 +28,7 @@
import action_litesync
from utils import _

#--------------------------------------------
# --------------------------------------------


class Systems(collection.Collection):
Expand Down
10 changes: 5 additions & 5 deletions cobbler/configgen.py
Expand Up @@ -49,14 +49,14 @@ def __init__(self, hostname):
self.logger = clogger.Logger("/var/log/cobbler/cobbler.log")
self.mgmtclasses = self.get_cobbler_resource('mgmt_classes')

#----------------------------------------------------------------------
# ----------------------------------------------------------------------

def resolve_resource_var(self, string_data):
"""Substitute variables in strings."""
data = string.Template(string_data).substitute(self.host_vars)
return data

#----------------------------------------------------------------------
# ----------------------------------------------------------------------

def resolve_resource_list(self, list_data):
"""Substitute variables in lists. Return new list."""
Expand All @@ -65,13 +65,13 @@ def resolve_resource_list(self, list_data):
new_list.append(string.Template(item).substitute(self.host_vars))
return new_list

#----------------------------------------------------------------------
# ----------------------------------------------------------------------

def get_cobbler_resource(self, resource):
"""Wrapper around cobbler blender method"""
return cobbler.utils.blender(self.handle, False, self.system)[resource]

#----------------------------------------------------------------------
# ----------------------------------------------------------------------

def gen_config_data(self):
"""
Expand Down Expand Up @@ -148,7 +148,7 @@ def gen_config_data(self):
config_data['files'] = file_data
return config_data

#----------------------------------------------------------------------
# ----------------------------------------------------------------------

def gen_config_data_for_koan(self):
"""Encode configuration data. Return json object for Koan."""
Expand Down
10 changes: 5 additions & 5 deletions cobbler/kickgen.py
Expand Up @@ -106,8 +106,8 @@ def generate_autoyast(self, profile=None, system=None, raw_data=None):
# add some cobbler information to the XML file
# maybe that should be configureable
if addComment == 1:
#startComment = document.createComment("\ncobbler_system_name=$system_name\ncobbler_server=$server\n#raw\n")
#endComment = document.createComment("\n#end raw\n")
# startComment = document.createComment("\ncobbler_system_name=$system_name\ncobbler_server=$server\n#raw\n")
# endComment = document.createComment("\n#end raw\n")
cobblerElement = document.createElement("cobbler")
cobblerElementSystem = xml.dom.minidom.Element("system_name")
cobblerElementProfile = xml.dom.minidom.Element("profile_name")
Expand All @@ -129,9 +129,9 @@ def generate_autoyast(self, profile=None, system=None, raw_data=None):
# FIXME: this is all broken and no longer works.
# this entire if block should probably not be
# hard-coded anyway
#self.api.log(document.childNodes[2].childNodes)
#document.childNodes[1].insertBefore( cobblerElement, document.childNodes[2].childNodes[1])
#document.childNodes[1].insertBefore( cobblerElement, document.childNodes[1].childNodes[0])
# self.api.log(document.childNodes[2].childNodes)
# document.childNodes[1].insertBefore( cobblerElement, document.childNodes[2].childNodes[1])
# document.childNodes[1].insertBefore( cobblerElement, document.childNodes[1].childNodes[0])

name = profile.name
if system is not None:
Expand Down
4 changes: 2 additions & 2 deletions cobbler/modules/authn_spacewalk.py
Expand Up @@ -50,10 +50,10 @@ def __looks_like_a_token(password):
# tokens are always lowercase, this isn't a token
return False

#try:
# try:
# #data = binascii.unhexlify(password)
# return True # looks like a token, but we can't be sure
#except:
# except:
# return False # definitely not a token

return (len(password) > 45)
Expand Down
4 changes: 2 additions & 2 deletions cobbler/modules/manage_import_signatures.py
Expand Up @@ -159,7 +159,7 @@ def scan_signatures(self):
the signature directory and the version file
"""
sigdata = self.api.get_signatures()
#self.logger.debug("signature cache: %s" % str(sigdata))
# self.logger.debug("signature cache: %s" % str(sigdata))
for breed in sigdata["breeds"].keys():
if self.breed and self.breed != breed:
continue
Expand Down Expand Up @@ -235,7 +235,7 @@ def distro_adder(self, distros_added, dirname, fnames):
if os.path.islink(fullname) and os.path.isdir(fullname):
if fullname.startswith(self.path):
# Prevent infinite loop with Sci Linux 5
#self.logger.warning("avoiding symlink loop")
# self.logger.warning("avoiding symlink loop")
continue
self.logger.info("following symlink: %s" % fullname)
os.path.walk(fullname, self.distro_adder, distros_added)
Expand Down
2 changes: 1 addition & 1 deletion cobbler/modules/serializer_catalog.py
Expand Up @@ -94,7 +94,7 @@ def serialize_item(obj, item):
datastruct = item.to_datastruct()
fd = open(filename, "w+")
data = simplejson.dumps(datastruct, encoding="utf-8", sort_keys=sort_keys, indent=indent)
#data = data.encode('utf-8')
# data = data.encode('utf-8')
fd.write(data)

else:
Expand Down
2 changes: 1 addition & 1 deletion cobbler/pxegen.py
Expand Up @@ -131,7 +131,7 @@ def copy_bootloaders(self):
shutil.rmtree(os.path.join(self.bootloc, 'boot'))
for i in self.distros:
if 'nexenta' == i.breed and not pxegrub_imported:
#name_without_arch = i.name[:-7] # removing -x86_64 from the fin on the string.
# name_without_arch = i.name[:-7] # removing -x86_64 from the fin on the string.
shutil.copytree(os.path.join('/var', 'www', 'cobbler', 'ks_mirror', i.name, 'boot'),
os.path.join(self.bootloc, 'boot'))
pxegrub_imported = True
Expand Down
2 changes: 1 addition & 1 deletion cobbler/remote.py
Expand Up @@ -1060,7 +1060,7 @@ def get_kickstart_templates(self, token=None, **rest):
Returns all of the kickstarts that are in use by the system.
"""
self._log("get_kickstart_templates", token=token)
#self.check_access(token, "get_kickstart_templates")
# self.check_access(token, "get_kickstart_templates")
return utils.get_kickstart_templates(self.api)

def get_snippets(self, token=None, **rest):
Expand Down
20 changes: 10 additions & 10 deletions cobbler/utils.py
Expand Up @@ -342,10 +342,10 @@ def find_kernel(path):
return None

if os.path.isfile(path):
#filename = os.path.basename(path)
#if _re_kernel.match(filename):
# filename = os.path.basename(path)
# if _re_kernel.match(filename):
# return path
#elif filename == "vmlinuz":
# elif filename == "vmlinuz":
# return path
return path

Expand Down Expand Up @@ -390,10 +390,10 @@ def find_initrd(path):
return None

if os.path.isfile(path):
#filename = os.path.basename(path)
#if _re_initrd.match(filename):
# filename = os.path.basename(path)
# if _re_initrd.match(filename):
# return path
#if filename == "initrd.img" or filename == "initrd":
# if filename == "initrd.img" or filename == "initrd":
# return path
return path

Expand Down Expand Up @@ -579,12 +579,12 @@ def input_boolean(value):

def update_settings_file(data):
if 1:
#clogger.Logger().debug("in update_settings_file(): value is: %s" % str(value))
# clogger.Logger().debug("in update_settings_file(): value is: %s" % str(value))
settings_file = file("/etc/cobbler/settings", "w")
yaml.safe_dump(data, settings_file)
settings_file.close()
return True
#except:
# except:
# return False


Expand Down Expand Up @@ -1902,7 +1902,7 @@ def to_datastruct_from_fields(obj, fields):
# they are the only exception in Cobbler.
if obj.COLLECTION_TYPE == "system":
ds["interfaces"] = copy.deepcopy(obj.interfaces)
#for interface in ds["interfaces"].keys():
# for interface in ds["interfaces"].keys():
# for k in ds["interfaces"][interface].keys():
# if field_info.DEPRECATED_FIELDS.has_key(k):
# ds["interfaces"][interface][field_info.DEPRECATED_FIELDS[k]] = ds["interfaces"][interface][k]
Expand Down Expand Up @@ -2011,7 +2011,7 @@ def add_options_from_fields(object_type, parser, fields, object_action):
parser.add_option("--recursive", action="store_true", dest="recursive", help="also delete child objects")

# FIXME: not supported in 2.0 ?
#if not object_action in ["dumpvars","find","remove","report","list"]:
# if not object_action in ["dumpvars","find","remove","report","list"]:
# parser.add_option("--no-sync", action="store_true", dest="nosync", help="suppress sync for speed")
# FIXME: not supported in 2.0 ?
# if not matches_args(args,["dumpvars","report","list"]):
Expand Down

0 comments on commit e383109

Please sign in to comment.