diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2018-11-06 17:41:12 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-11-21 07:46:20 +0100 |
commit | 10855509852f8e6bc42d5410e59e76fbf2f14657 (patch) | |
tree | c5e70b799bb894ec459a7989999ad922b86bf6b9 /python | |
parent | 2851cd5bccde53a049bbd3774911b7dc4b970467 (diff) | |
download | samba-10855509852f8e6bc42d5410e59e76fbf2f14657.tar.gz |
netcmd/ldapcmp: fix wrong way for string copy
Two mistakes here:
- res[:-1] will copy but lost the last char
- string is immutable in python, there is no need to copy it explicitly
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/netcmd/ldapcmp.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py index eca1ecd91e6..646eedc0e80 100644 --- a/python/samba/netcmd/ldapcmp.py +++ b/python/samba/netcmd/ldapcmp.py @@ -565,8 +565,8 @@ class LDAPObject(object): else: raise Exception("Unknown --view option value.") # - self.screen_output = res[1][:-1] - other.screen_output = res[1][:-1] + self.screen_output = res[1] + other.screen_output = res[1] # return res[0] @@ -681,8 +681,8 @@ class LDAPObject(object): other.summary["unique_attrs"] += other.unique_attrs other.summary["df_value_attrs"] += self.df_value_attrs # they are the same # - self.screen_output = res[:-1] - other.screen_output = res[:-1] + self.screen_output = res + other.screen_output = res # return res == "" |