client/tools/rhncfg/config_client/rhncfgcli_elist.py | 3 +--
client/tools/rhncfg/config_client/rhncfgcli_list.py | 16 +++++++++-------
2 files changed, 10 insertions(+), 9 deletions(-)
New commits:
commit b6f6ba4c08816ecaba9a5f94dd5bc3db34b14210
Author: Partha Aji <paji(a)redhat.com>
Date: Thu Jul 29 13:22:43 2010 -0400
Config Client changes to get symlinks to work
For rhncfgclient-list and elist calls
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_elist.py
b/client/tools/rhncfg/config_client/rhncfgcli_elist.py
index 9adf8be..dcb5102 100755
--- a/client/tools/rhncfg/config_client/rhncfgcli_elist.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_elist.py
@@ -93,7 +93,6 @@ class Handler(handler_base.HandlerBase):
# Get the file info
finfo = r.get_file_info(file[1])[1]
-
# Get the file length
if finfo['encoding'] == 'base64':
fsize = len(base64.decodestring(finfo['file_contents']))
@@ -101,6 +100,6 @@ class Handler(handler_base.HandlerBase):
# * indicates raw 'unencoded' size
fsize = '*' + str(len(finfo['file_contents']))
- permstr = self.ostr_to_sym(finfo['filemode'],
finfo['filetype'])
+ permstr = finfo['filetype'] != 'symlink' and
self.ostr_to_sym(finfo['filemode'], finfo['filetype']) or ''
print "%10s %8s %-8s %10s %+3s %*s %s" % (permstr,
finfo['username'], finfo['groupname'], fsize, finfo['revision'],
maxlen, file[0], file[1])
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_list.py
b/client/tools/rhncfg/config_client/rhncfgcli_list.py
index 3e2615d..ae597b2 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_list.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_list.py
@@ -34,10 +34,12 @@ class Handler(handler_base.HandlerBase):
print "DoF %*s %s" % (maxlen, label, "File")
for file in files:
- # checking to see if the filetype is in the 'file' entry,
- # and if it is and that type is '1', it is a file
- if (len(file) < 3) or file[2] == 1:
- print "F %*s %s" % (maxlen, file[0], file[1])
- else:
- # the filetype is a directory
- print "D %*s %s" % (maxlen, file[0], file[1])
+ # checking to see if the filetype is in the 'file' entry,
+ # and if it is and that type is '1', it is a file
+ if (len(file) < 3) or file[2] == 1:
+ print "F %*s %s" % (maxlen, file[0], file[1])
+ elif file[2] == 2 :
+ # the filetype is a directory
+ print "D %*s %s" % (maxlen, file[0], file[1])
+ else:
+ print "S %*s %s" % (maxlen, file[0], file[1])
Show replies by thread