22.03.2016, 19:30, Martin Basti kirjoitti:
> 
> 
> On 22.03.2016 10:43, Martin Basti wrote:
>>
>>
>> On 18.03.2016 11:53, Christian Heimes wrote:
>>> On 2016-03-18 10:22, Martin Basti wrote:
>>>>
>>>> On 29.02.2016 16:02, David Kupka wrote:
>>>>> Hello Christian,
>>>>> sorry for letting this patch rot for so long. I've forget about it
>>>>> the minute Fraser replied.
>>>>> To compensate a little I've fixed pep8 error, rebased it and
>>>>> attaching two versions for master and for 4.3 branch.
>>>>> I haven't found any missing cases and it works for me. If you're OK
>>>>> with the modified patches it can be pushed.
>>>>>
>>>>> David
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Christian Heimes" <chei...@redhat.com>
>>>>> To: "Fraser Tweedale" <ftwee...@redhat.com>
>>>>> Cc: "freeipa-devel" <freeipa-devel@redhat.com>
>>>>> Sent: Wednesday, January 20, 2016 11:57:42 AM
>>>>> Subject: Re: [Freeipa-devel] [PATCH 0029] Move user/group constants
>>>>> for PKI and DS into ipaplatform
>>>>>
>>>>> On 2016-01-20 02:54, Fraser Tweedale wrote:
>>>>>> On Tue, Jan 19, 2016 at 02:20:27PM +0100, Christian Heimes wrote:
>>>>>>> ipaplatform.constants has platform specific names for a couple of
>>>>>>> system
>>>>>>> users like Apache HTTPD. The user names for PKI_USER, PKI_GROUP,
>>>>>>> DS_USER
>>>>>>> and DS_GROUP are defined in other modules. Similar to #5587 the
>>>>>>> patch my
>>>>>>> patch moves the constants into the platform module.
>>>>>>>
>>>>>>> https://fedorahosted.org/freeipa/ticket/5619
>>>>>> I see a few remaining cases:
>>>>>>
>>>>>> ipaserver/install/dsinstance.py
>>>>>> 712:        pent = pwd.getpwnam("dirsrv")
>>>>>>
>>>>>> ipatests/test_integration/test_backup_and_restore.py
>>>>>> 167:            self.master.run_command(['userdel', 'dirsrv'])
>>>>>> 168:            self.master.run_command(['userdel', 'pkiuser'])
>>>>>>
>>>>>> ipaplatform/redhat/tasks.py
>>>>>> 441:        if name == 'pkiuser':
>>>>>>
>>>>>> When these are included, ACK.
>>>>> Good catch!
>>>>>
>>>>> My new patch takes care of remaining cases.
>>>>>
>>>>>
>>>>>
>>>>>
>>>> Christian do you agree with proposed changes, can we push it?
>>>> Martin^2
>>> Oh, the patch is still open? ACK!
>>>
>>>
>> Pushed to ipa-4-3: e3bf65f2df9c50873f0967b96a6a2a5975a87f79
>> Pushed to master: 49be6c8d3cc20902dbe8e92a74e31aed2fd21d9f
>>
> too-late-NACK
> 
> This patch broke ipa-restore.
> 
> please not that 2 modules are imported as same name in ipa_restore.py
> from ipalib import api, errors, constants
> from ipaplatform.constants import constants
> 
> 2016-03-22T16:56:27Z DEBUG   File
> "/usr/lib/python2.7/site-packages/ipapython/admintool.py", line 171, in
> execute
>     return_value = self.run()
>   File
> "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_restore.py",
> line 218, in run
>     self.backup_dir, constants.FQDN)

this should fix it

-- 
t
From d161e7ad51c90be6643a2851d5d21e1ae8a375dd Mon Sep 17 00:00:00 2001
From: Timo Aaltonen <tjaal...@debian.org>
Date: Tue, 22 Mar 2016 21:05:39 +0200
Subject: [PATCH] ipa_restore: Import only FQDN from ipalib.constants

---
 ipaserver/install/ipa_restore.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py
index 214409e..2656536 100644
--- a/ipaserver/install/ipa_restore.py
+++ b/ipaserver/install/ipa_restore.py
@@ -27,7 +27,8 @@ import itertools
 
 from six.moves.configparser import SafeConfigParser
 
-from ipalib import api, errors, constants
+from ipalib import api, errors
+from ipalib.constants import FQDN
 from ipapython import version, ipautil, certdb
 from ipapython.ipautil import run, user_input
 from ipapython import admintool
@@ -215,7 +216,7 @@ class Restore(admintool.AdminTool):
             self.backup_dir = os.path.join(paths.IPA_BACKUP_DIR, self.backup_dir)
 
         self.log.info("Preparing restore from %s on %s",
-                      self.backup_dir, constants.FQDN)
+                      self.backup_dir, FQDN)
 
         self.header = os.path.join(self.backup_dir, 'header')
 
@@ -278,10 +279,10 @@ class Restore(admintool.AdminTool):
         self.log.info("Performing %s restore from %s backup" %
                       (restore_type, self.backup_type))
 
-        if self.backup_host != constants.FQDN:
+        if self.backup_host != FQDN:
             raise admintool.ScriptError(
                 "Host name %s does not match backup name %s" %
-                (constants.FQDN, self.backup_host))
+                (FQDN, self.backup_host))
 
         if self.backup_ipa_version != str(version.VERSION):
             self.log.warning(
-- 
2.7.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to