client/tools/rhncfg/config_management/rhncfg_add.py | 2 +- client/tools/rhncfg/config_management/rhncfg_diff.py | 6 +++--- client/tools/rhncfg/config_management/rhncfg_remove.py | 2 +- client/tools/rhncfg/config_management/rhncfg_upload_channel.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit 7e84ae9095f1309d113a3d2e58e349b9714ef2e7 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Nov 26 14:40:44 2010 +0100
656895 - fixing other instances of two-parameter utils.startswith.
diff --git a/client/tools/rhncfg/config_management/rhncfg_add.py b/client/tools/rhncfg/config_management/rhncfg_add.py index c522c32..19ebc4d 100644 --- a/client/tools/rhncfg/config_management/rhncfg_add.py +++ b/client/tools/rhncfg/config_management/rhncfg_add.py @@ -81,7 +81,7 @@ class Handler(handler_base.HandlerBase): self.options.topdir = utils.rm_trailing_slash(self.options.topdir)
for f in files: - if not utils.startswith(f, self.options.topdir): + if not f.startswith(self.options.topdir): die(8, "--topdir %s specified, but file `%s' doesn't comply" % (self.options.topdir, f)) files_to_push.append((f, f[len(self.options.topdir):])) diff --git a/client/tools/rhncfg/config_management/rhncfg_diff.py b/client/tools/rhncfg/config_management/rhncfg_diff.py index 1e95a2d..b1d7b42 100644 --- a/client/tools/rhncfg/config_management/rhncfg_diff.py +++ b/client/tools/rhncfg/config_management/rhncfg_diff.py @@ -83,7 +83,7 @@ class Handler(handler_base.HandlerBase): topdir = utils.rm_trailing_slash(topdir)
for f in files: - if not utils.startswith(f, topdir): + if not f.startswith(topdir): die(8, "--topdir %s specified, but file `%s' doesn't comply" % (topdir, f)) if os.path.isdir(f) and not os.path.islink(f): @@ -132,11 +132,11 @@ class Handler(handler_base.HandlerBase): first_row = pipe.readline() if not first_row: return "" - elif utils.startswith(first_row, "---"): + elif first_row.startswith("---"): first_row = "--- %s\tconfig_channel: %s\trevision: %s\n" % ( path, channel, info['revision'] ) - elif utils.startswith(first_row, "***"): + elif first_row.startswith("***"): # This happens when we drop back to "diff -c" first_row = "*** %s\tconfig_channel: %s\trevision: %s\n" % ( path, channel, info['revision'] diff --git a/client/tools/rhncfg/config_management/rhncfg_remove.py b/client/tools/rhncfg/config_management/rhncfg_remove.py index ae17ed8..c04d027 100644 --- a/client/tools/rhncfg/config_management/rhncfg_remove.py +++ b/client/tools/rhncfg/config_management/rhncfg_remove.py @@ -55,7 +55,7 @@ class Handler(handler_base.HandlerBase): die(8, "--topdir specified, but `%s' not a directory" % self.options.topdir) for f in files: - if not utils.startswith(f, self.options.topdir): + if not f.startswith(self.options.topdir): die(8, "--topdir %s specified, but file `%s' doesn't comply" % (self.options.topdir, f)) files_to_remove.append((f, f[len(self.options.topdir):])) diff --git a/client/tools/rhncfg/config_management/rhncfg_upload_channel.py b/client/tools/rhncfg/config_management/rhncfg_upload_channel.py index 0944df8..8a153a7 100644 --- a/client/tools/rhncfg/config_management/rhncfg_upload_channel.py +++ b/client/tools/rhncfg/config_management/rhncfg_upload_channel.py @@ -96,7 +96,7 @@ class Handler(handler_base.HandlerBase): flist = list_files_recursive(channel_dir)
for (dirname, filenames) in flist: - assert utils.startswith(dirname, channel_dir) + assert dirname.startswith(channel_dir) remote_dirname = dirname[len(channel_dir):]
for f in filenames: