Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-07-02 Thread Tomas Babej


On 07/01/2015 07:32 PM, Martin Babinsky wrote:
> On 06/30/2015 05:55 PM, Tomas Babej wrote:
>>
>>
>> On 06/16/2015 01:01 PM, Jan Cholasta wrote:
>>> Dne 16.6.2015 v 10:14 Martin Babinsky napsal(a):
 On 05/06/2015 10:12 AM, Tomas Babej wrote:
>
>
> On 05/05/2015 02:02 PM, Tomas Babej wrote:
>>
>>
>> On 04/29/2015 12:28 PM, Tomas Babej wrote:
>>>
>>>
>>> On 03/11/2015 04:20 PM, Jan Cholasta wrote:
 Hi,

 Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):
>
> On 03/09/2015 12:26 PM, Tomas Babej wrote:
>> Hi,
>>
>> this couple of patches provides a initial implementation of the
>> winsync migration tool:
>>
>> https://fedorahosted.org/freeipa/ticket/4524
>>
>> Some parts could use some polishing, but this is a sound
>> foundation.
>>
>> Tomas
>>
>>
>>
>
> Attaching one more patch to the bundle. This one should make the
> winsync
> tool readily available after install.
>
> Tomas
>
>

 Nitpicks:

 The winsync_migrate module should be in ipaserver.install. Also I
 don't see why it has to be a package when there is just one short
 file in it.

 By convention, the AdminTool subclass should be named
 WinsyncMigrate, or the tool should be named ipa-migrate-winsync.

 Honza

>>>
>>> Updated patches attached.
>>>
>>> Tomas
>>
>> Rebased patches with cleaned membership bits.
>>
>> Tomas
>
> I did some self-review, updated patches attached.
>
>
 Hi Tomas,

 patches look good and seem to work as expected. I have some comments:

 1.) When running the tool I get a number of warnings about users not
 found (https://paste.fedoraproject.org/232251/43884831/), but in the
 end
 everything seems to be fine and users are migrated in the external
 groups just fine. Is this behavior normal?

>>
>> In that case, yes. What happened here is that SSSD in POSIX trust will
>> not resolve users that do not have POSIX attributes set. Winsync
>> synchornizes all the users, hence the discrepancy.
>>
>>
 2.) Since both "--realm" and "--server" options are mandatory, I was
 thinking if it would be better to use positional arguments, since you
 always have to specify them. What are your thought on this?
>>>
>>> I would rather stay consistent with ipa-server-install and friends and
>>> keep them as options.
>>>

 3.) Patches 317-318 seem to just just rename/move things and could be
 squashed in the previous ones. But that is just a minor thing and I
 leave that to your discretion.

 4.) After all the renaming and moving around the WinsyncMigrate class
 (see previous point) there is an unused file
 "ipaserver/winsync_migrate/__init__.py" left. You should remove it in
 some patch (e.g. in patch 318 if you decide to keep it).
>>
>> I removed the file and squashed the change into 318.
>>
>>>
>>> Also please rename the class to "MigrateWinsync", for consistency.
>>>
>>
>> Naming is consistent, the tool is called ipa-winsync-migrate, class is
>> called WinsyncMigrate. This is consistent with other IPA tools.
>>
>>

 5.) Option "--log-file" seems to be broken. When specified on CLI the
 log is created but empty, the program prints out nothing and then exits
 without doing anything. However, I suspect that this is AdminTool's
 problem, not yours.

>>
>> Yep. Please, file a ticket for this more generic issue.
>>
> 
> Will do.
> 
> Otherwise ACK.
> 

Pushed to master: 8d30feb5391026a42a2f8da5df8d539311963b86

-- 
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


Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-07-01 Thread Martin Babinsky

On 06/30/2015 05:55 PM, Tomas Babej wrote:



On 06/16/2015 01:01 PM, Jan Cholasta wrote:

Dne 16.6.2015 v 10:14 Martin Babinsky napsal(a):

On 05/06/2015 10:12 AM, Tomas Babej wrote:



On 05/05/2015 02:02 PM, Tomas Babej wrote:



On 04/29/2015 12:28 PM, Tomas Babej wrote:



On 03/11/2015 04:20 PM, Jan Cholasta wrote:

Hi,

Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the
winsync migration tool:

https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound
foundation.

Tomas





Attaching one more patch to the bundle. This one should make the
winsync
tool readily available after install.

Tomas




Nitpicks:

The winsync_migrate module should be in ipaserver.install. Also I
don't see why it has to be a package when there is just one short
file in it.

By convention, the AdminTool subclass should be named
WinsyncMigrate, or the tool should be named ipa-migrate-winsync.

Honza



Updated patches attached.

Tomas


Rebased patches with cleaned membership bits.

Tomas


I did some self-review, updated patches attached.



Hi Tomas,

patches look good and seem to work as expected. I have some comments:

1.) When running the tool I get a number of warnings about users not
found (https://paste.fedoraproject.org/232251/43884831/), but in the end
everything seems to be fine and users are migrated in the external
groups just fine. Is this behavior normal?



In that case, yes. What happened here is that SSSD in POSIX trust will
not resolve users that do not have POSIX attributes set. Winsync
synchornizes all the users, hence the discrepancy.



2.) Since both "--realm" and "--server" options are mandatory, I was
thinking if it would be better to use positional arguments, since you
always have to specify them. What are your thought on this?


I would rather stay consistent with ipa-server-install and friends and
keep them as options.



3.) Patches 317-318 seem to just just rename/move things and could be
squashed in the previous ones. But that is just a minor thing and I
leave that to your discretion.

4.) After all the renaming and moving around the WinsyncMigrate class
(see previous point) there is an unused file
"ipaserver/winsync_migrate/__init__.py" left. You should remove it in
some patch (e.g. in patch 318 if you decide to keep it).


I removed the file and squashed the change into 318.



Also please rename the class to "MigrateWinsync", for consistency.



Naming is consistent, the tool is called ipa-winsync-migrate, class is
called WinsyncMigrate. This is consistent with other IPA tools.




5.) Option "--log-file" seems to be broken. When specified on CLI the
log is created but empty, the program prints out nothing and then exits
without doing anything. However, I suspect that this is AdminTool's
problem, not yours.



Yep. Please, file a ticket for this more generic issue.



Will do.

Otherwise ACK.

--
Martin^3 Babinsky

--
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


Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-06-30 Thread Jan Cholasta

Dne 30.6.2015 v 17:55 Tomas Babej napsal(a):



On 06/16/2015 01:01 PM, Jan Cholasta wrote:


Also please rename the class to "MigrateWinsync", for consistency.



Naming is consistent, the tool is called ipa-winsync-migrate, class is
called WinsyncMigrate. This is consistent with other IPA tools.


Ah, I didn't notice you renamed it in a separate patch, as we normally 
do that by fixing the original patch. Which is what you really should 
have done as well, I don't see how such patch spamming is good for anyone.


--
Jan Cholasta

--
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


Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-06-30 Thread Tomas Babej


On 06/16/2015 01:01 PM, Jan Cholasta wrote:
> Dne 16.6.2015 v 10:14 Martin Babinsky napsal(a):
>> On 05/06/2015 10:12 AM, Tomas Babej wrote:
>>>
>>>
>>> On 05/05/2015 02:02 PM, Tomas Babej wrote:


 On 04/29/2015 12:28 PM, Tomas Babej wrote:
>
>
> On 03/11/2015 04:20 PM, Jan Cholasta wrote:
>> Hi,
>>
>> Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):
>>>
>>> On 03/09/2015 12:26 PM, Tomas Babej wrote:
 Hi,

 this couple of patches provides a initial implementation of the
 winsync migration tool:

 https://fedorahosted.org/freeipa/ticket/4524

 Some parts could use some polishing, but this is a sound
 foundation.

 Tomas



>>>
>>> Attaching one more patch to the bundle. This one should make the
>>> winsync
>>> tool readily available after install.
>>>
>>> Tomas
>>>
>>>
>>
>> Nitpicks:
>>
>> The winsync_migrate module should be in ipaserver.install. Also I
>> don't see why it has to be a package when there is just one short
>> file in it.
>>
>> By convention, the AdminTool subclass should be named
>> WinsyncMigrate, or the tool should be named ipa-migrate-winsync.
>>
>> Honza
>>
>
> Updated patches attached.
>
> Tomas

 Rebased patches with cleaned membership bits.

 Tomas
>>>
>>> I did some self-review, updated patches attached.
>>>
>>>
>> Hi Tomas,
>>
>> patches look good and seem to work as expected. I have some comments:
>>
>> 1.) When running the tool I get a number of warnings about users not
>> found (https://paste.fedoraproject.org/232251/43884831/), but in the end
>> everything seems to be fine and users are migrated in the external
>> groups just fine. Is this behavior normal?
>>

In that case, yes. What happened here is that SSSD in POSIX trust will
not resolve users that do not have POSIX attributes set. Winsync
synchornizes all the users, hence the discrepancy.


>> 2.) Since both "--realm" and "--server" options are mandatory, I was
>> thinking if it would be better to use positional arguments, since you
>> always have to specify them. What are your thought on this?
> 
> I would rather stay consistent with ipa-server-install and friends and
> keep them as options.
> 
>>
>> 3.) Patches 317-318 seem to just just rename/move things and could be
>> squashed in the previous ones. But that is just a minor thing and I
>> leave that to your discretion.
>>
>> 4.) After all the renaming and moving around the WinsyncMigrate class
>> (see previous point) there is an unused file
>> "ipaserver/winsync_migrate/__init__.py" left. You should remove it in
>> some patch (e.g. in patch 318 if you decide to keep it).

I removed the file and squashed the change into 318.

> 
> Also please rename the class to "MigrateWinsync", for consistency.
> 

Naming is consistent, the tool is called ipa-winsync-migrate, class is
called WinsyncMigrate. This is consistent with other IPA tools.


>>
>> 5.) Option "--log-file" seems to be broken. When specified on CLI the
>> log is created but empty, the program prints out nothing and then exits
>> without doing anything. However, I suspect that this is AdminTool's
>> problem, not yours.
>>

Yep. Please, file a ticket for this more generic issue.

From 3be5216cb2c58808a56755e03463c2d370921ec4 Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Wed, 29 Apr 2015 08:15:50 +0200
Subject: [PATCH] winsync-migrate: Add initial plumbing

https://fedorahosted.org/freeipa/ticket/4524
---
 install/tools/ipa-winsync-migrate | 23 
 ipaserver/winsync_migrate/__init__.py | 22 
 ipaserver/winsync_migrate/base.py | 67 +++
 3 files changed, 112 insertions(+)
 create mode 100755 install/tools/ipa-winsync-migrate
 create mode 100644 ipaserver/winsync_migrate/__init__.py
 create mode 100644 ipaserver/winsync_migrate/base.py

diff --git a/install/tools/ipa-winsync-migrate b/install/tools/ipa-winsync-migrate
new file mode 100755
index ..9eb9a03eb92396c855706e0f85850baece45b27e
--- /dev/null
+++ b/install/tools/ipa-winsync-migrate
@@ -0,0 +1,23 @@
+#! /usr/bin/python2 -E
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public Lice

Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-06-16 Thread Jan Cholasta

Dne 16.6.2015 v 10:14 Martin Babinsky napsal(a):

On 05/06/2015 10:12 AM, Tomas Babej wrote:



On 05/05/2015 02:02 PM, Tomas Babej wrote:



On 04/29/2015 12:28 PM, Tomas Babej wrote:



On 03/11/2015 04:20 PM, Jan Cholasta wrote:

Hi,

Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the
winsync migration tool:

https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas





Attaching one more patch to the bundle. This one should make the
winsync
tool readily available after install.

Tomas




Nitpicks:

The winsync_migrate module should be in ipaserver.install. Also I
don't see why it has to be a package when there is just one short
file in it.

By convention, the AdminTool subclass should be named
WinsyncMigrate, or the tool should be named ipa-migrate-winsync.

Honza



Updated patches attached.

Tomas


Rebased patches with cleaned membership bits.

Tomas


I did some self-review, updated patches attached.



Hi Tomas,

patches look good and seem to work as expected. I have some comments:

1.) When running the tool I get a number of warnings about users not
found (https://paste.fedoraproject.org/232251/43884831/), but in the end
everything seems to be fine and users are migrated in the external
groups just fine. Is this behavior normal?

2.) Since both "--realm" and "--server" options are mandatory, I was
thinking if it would be better to use positional arguments, since you
always have to specify them. What are your thought on this?


I would rather stay consistent with ipa-server-install and friends and 
keep them as options.




3.) Patches 317-318 seem to just just rename/move things and could be
squashed in the previous ones. But that is just a minor thing and I
leave that to your discretion.

4.) After all the renaming and moving around the WinsyncMigrate class
(see previous point) there is an unused file
"ipaserver/winsync_migrate/__init__.py" left. You should remove it in
some patch (e.g. in patch 318 if you decide to keep it).


Also please rename the class to "MigrateWinsync", for consistency.



5.) Option "--log-file" seems to be broken. When specified on CLI the
log is created but empty, the program prints out nothing and then exits
without doing anything. However, I suspect that this is AdminTool's
problem, not yours.




--
Jan Cholasta

--
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


Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-06-16 Thread Martin Babinsky

On 05/06/2015 10:12 AM, Tomas Babej wrote:



On 05/05/2015 02:02 PM, Tomas Babej wrote:



On 04/29/2015 12:28 PM, Tomas Babej wrote:



On 03/11/2015 04:20 PM, Jan Cholasta wrote:

Hi,

Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the
winsync migration tool:

https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas





Attaching one more patch to the bundle. This one should make the
winsync
tool readily available after install.

Tomas




Nitpicks:

The winsync_migrate module should be in ipaserver.install. Also I
don't see why it has to be a package when there is just one short
file in it.

By convention, the AdminTool subclass should be named
WinsyncMigrate, or the tool should be named ipa-migrate-winsync.

Honza



Updated patches attached.

Tomas


Rebased patches with cleaned membership bits.

Tomas


I did some self-review, updated patches attached.



Hi Tomas,

patches look good and seem to work as expected. I have some comments:

1.) When running the tool I get a number of warnings about users not 
found (https://paste.fedoraproject.org/232251/43884831/), but in the end 
everything seems to be fine and users are migrated in the external 
groups just fine. Is this behavior normal?


2.) Since both "--realm" and "--server" options are mandatory, I was 
thinking if it would be better to use positional arguments, since you 
always have to specify them. What are your thought on this?


3.) Patches 317-318 seem to just just rename/move things and could be 
squashed in the previous ones. But that is just a minor thing and I 
leave that to your discretion.


4.) After all the renaming and moving around the WinsyncMigrate class 
(see previous point) there is an unused file 
"ipaserver/winsync_migrate/__init__.py" left. You should remove it in 
some patch (e.g. in patch 318 if you decide to keep it).


5.) Option "--log-file" seems to be broken. When specified on CLI the 
log is created but empty, the program prints out nothing and then exits
without doing anything. However, I suspect that this is AdminTool's 
problem, not yours.


--
Martin^3 Babinsky

--
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


Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-05-06 Thread Tomas Babej



On 05/05/2015 02:02 PM, Tomas Babej wrote:



On 04/29/2015 12:28 PM, Tomas Babej wrote:



On 03/11/2015 04:20 PM, Jan Cholasta wrote:

Hi,

Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the
winsync migration tool:

https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas





Attaching one more patch to the bundle. This one should make the 
winsync

tool readily available after install.

Tomas




Nitpicks:

The winsync_migrate module should be in ipaserver.install. Also I 
don't see why it has to be a package when there is just one short 
file in it.


By convention, the AdminTool subclass should be named 
WinsyncMigrate, or the tool should be named ipa-migrate-winsync.


Honza



Updated patches attached.

Tomas


Rebased patches with cleaned membership bits.

Tomas


I did some self-review, updated patches attached.
>From d98b18d7e1fe98eb81c9030b566ee28860a0d43e Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Wed, 29 Apr 2015 08:15:50 +0200
Subject: [PATCH] winsync-migrate: Add initial plumbing

https://fedorahosted.org/freeipa/ticket/4524
---
 install/tools/ipa-winsync-migrate | 23 
 ipaserver/winsync_migrate/__init__.py | 22 
 ipaserver/winsync_migrate/base.py | 67 +++
 3 files changed, 112 insertions(+)
 create mode 100755 install/tools/ipa-winsync-migrate
 create mode 100644 ipaserver/winsync_migrate/__init__.py
 create mode 100644 ipaserver/winsync_migrate/base.py

diff --git a/install/tools/ipa-winsync-migrate b/install/tools/ipa-winsync-migrate
new file mode 100755
index ..9eb9a03eb92396c855706e0f85850baece45b27e
--- /dev/null
+++ b/install/tools/ipa-winsync-migrate
@@ -0,0 +1,23 @@
+#! /usr/bin/python2 -E
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+from ipaserver.winsync_migrate.base import MigrateWinsync
+
+MigrateWinsync.run_cli()
diff --git a/ipaserver/winsync_migrate/__init__.py b/ipaserver/winsync_migrate/__init__.py
new file mode 100644
index ..e0da63db3a369adc4a34e8675471929b5839a812
--- /dev/null
+++ b/ipaserver/winsync_migrate/__init__.py
@@ -0,0 +1,22 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+"""
+Base subpackage for winsync-migrate related code.
+"""
diff --git a/ipaserver/winsync_migrate/base.py b/ipaserver/winsync_migrate/base.py
new file mode 100644
index ..c21a861c2e49b4ab6d9783c117d1e4de126cb0b6
--- /dev/null
+++ b/ipaserver/winsync_migrate/base.py
@@ -0,0 +1,67 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+import krbV
+import sys
+
+from ipalib import api
+from ipalib import errors

Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-05-05 Thread Tomas Babej



On 04/29/2015 12:28 PM, Tomas Babej wrote:



On 03/11/2015 04:20 PM, Jan Cholasta wrote:

Hi,

Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the
winsync migration tool:

https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas





Attaching one more patch to the bundle. This one should make the 
winsync

tool readily available after install.

Tomas




Nitpicks:

The winsync_migrate module should be in ipaserver.install. Also I 
don't see why it has to be a package when there is just one short 
file in it.


By convention, the AdminTool subclass should be named WinsyncMigrate, 
or the tool should be named ipa-migrate-winsync.


Honza



Updated patches attached.

Tomas


Rebased patches with cleaned membership bits.

Tomas
>From d98b18d7e1fe98eb81c9030b566ee28860a0d43e Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Wed, 29 Apr 2015 08:15:50 +0200
Subject: [PATCH] winsync-migrate: Add initial plumbing

https://fedorahosted.org/freeipa/ticket/4524
---
 install/tools/ipa-winsync-migrate | 23 
 ipaserver/winsync_migrate/__init__.py | 22 
 ipaserver/winsync_migrate/base.py | 67 +++
 3 files changed, 112 insertions(+)
 create mode 100755 install/tools/ipa-winsync-migrate
 create mode 100644 ipaserver/winsync_migrate/__init__.py
 create mode 100644 ipaserver/winsync_migrate/base.py

diff --git a/install/tools/ipa-winsync-migrate b/install/tools/ipa-winsync-migrate
new file mode 100755
index ..9eb9a03eb92396c855706e0f85850baece45b27e
--- /dev/null
+++ b/install/tools/ipa-winsync-migrate
@@ -0,0 +1,23 @@
+#! /usr/bin/python2 -E
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+from ipaserver.winsync_migrate.base import MigrateWinsync
+
+MigrateWinsync.run_cli()
diff --git a/ipaserver/winsync_migrate/__init__.py b/ipaserver/winsync_migrate/__init__.py
new file mode 100644
index ..e0da63db3a369adc4a34e8675471929b5839a812
--- /dev/null
+++ b/ipaserver/winsync_migrate/__init__.py
@@ -0,0 +1,22 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+"""
+Base subpackage for winsync-migrate related code.
+"""
diff --git a/ipaserver/winsync_migrate/base.py b/ipaserver/winsync_migrate/base.py
new file mode 100644
index ..c21a861c2e49b4ab6d9783c117d1e4de126cb0b6
--- /dev/null
+++ b/ipaserver/winsync_migrate/base.py
@@ -0,0 +1,67 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+import krbV
+import sys
+
+from ipalib import api
+from ipalib import errors
+from ipapython import admintool
+from ipapython.dn import DN
+from ipapython.ipa_log_manager imp

Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-04-29 Thread Tomas Babej



On 03/11/2015 04:20 PM, Jan Cholasta wrote:

Hi,

Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the
winsync migration tool:

https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas





Attaching one more patch to the bundle. This one should make the winsync
tool readily available after install.

Tomas




Nitpicks:

The winsync_migrate module should be in ipaserver.install. Also I 
don't see why it has to be a package when there is just one short file 
in it.


By convention, the AdminTool subclass should be named WinsyncMigrate, 
or the tool should be named ipa-migrate-winsync.


Honza



Updated patches attached.

Tomas
>From 399edfdefcb66a613c5c6fa8bcd61f4272d3a9fc Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Wed, 29 Apr 2015 08:15:50 +0200
Subject: [PATCH] winsync-migrate: Add initial plumbing

---
 install/tools/ipa-winsync-migrate | 23 
 ipaserver/winsync_migrate/__init__.py | 22 
 ipaserver/winsync_migrate/base.py | 67 +++
 3 files changed, 112 insertions(+)
 create mode 100755 install/tools/ipa-winsync-migrate
 create mode 100644 ipaserver/winsync_migrate/__init__.py
 create mode 100644 ipaserver/winsync_migrate/base.py

diff --git a/install/tools/ipa-winsync-migrate b/install/tools/ipa-winsync-migrate
new file mode 100755
index ..9eb9a03eb92396c855706e0f85850baece45b27e
--- /dev/null
+++ b/install/tools/ipa-winsync-migrate
@@ -0,0 +1,23 @@
+#! /usr/bin/python2 -E
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+from ipaserver.winsync_migrate.base import MigrateWinsync
+
+MigrateWinsync.run_cli()
diff --git a/ipaserver/winsync_migrate/__init__.py b/ipaserver/winsync_migrate/__init__.py
new file mode 100644
index ..e0da63db3a369adc4a34e8675471929b5839a812
--- /dev/null
+++ b/ipaserver/winsync_migrate/__init__.py
@@ -0,0 +1,22 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+"""
+Base subpackage for winsync-migrate related code.
+"""
diff --git a/ipaserver/winsync_migrate/base.py b/ipaserver/winsync_migrate/base.py
new file mode 100644
index ..c21a861c2e49b4ab6d9783c117d1e4de126cb0b6
--- /dev/null
+++ b/ipaserver/winsync_migrate/base.py
@@ -0,0 +1,67 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+import krbV
+import sys
+
+from ipalib import api
+from ipalib import errors
+from ipapython import admintool
+from ipapython.dn import DN
+from ipapython.ipa_log_manager import log_mgr
+from ipaserver.plugins.ldap2 import ldap2
+
+
+class MigrateWinsync(admintool.AdminTool):
+"""
+Tool to migrate winsync users.

Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-03-12 Thread Jan Cholasta

Hi,

Dne 10.3.2015 v 16:35 Tomas Babej napsal(a):


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the
winsync migration tool:

https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas





Attaching one more patch to the bundle. This one should make the winsync
tool readily available after install.

Tomas




Nitpicks:

The winsync_migrate module should be in ipaserver.install. Also I don't 
see why it has to be a package when there is just one short file in it.


By convention, the AdminTool subclass should be named WinsyncMigrate, or 
the tool should be named ipa-migrate-winsync.


Honza

--
Jan Cholasta

--
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


Re: [Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-03-10 Thread Tomas Babej


On 03/09/2015 12:26 PM, Tomas Babej wrote:

Hi,

this couple of patches provides a initial implementation of the 
winsync migration tool:


https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas





Attaching one more patch to the bundle. This one should make the winsync 
tool readily available after install.


Tomas
>From f85aef188f8e03548b1acc5e2effe685c63e372b Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Mon, 9 Mar 2015 14:33:10 +0100
Subject: [PATCH] winsync-migrate: Include the tool parts in Makefile and
 friends

---
 freeipa.spec.in   | 2 ++
 install/tools/Makefile.am | 1 +
 setup.py  | 1 +
 3 files changed, 4 insertions(+)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index b186d9fdff31118ea4d929f024f4dc16a75b1d0b..0f5308b73f974a1e046201d148cbbbd21df7ceb7 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -660,6 +660,7 @@ fi
 %{_sbindir}/ipa-upgradeconfig
 %{_sbindir}/ipa-advise
 %{_sbindir}/ipa-cacert-manage
+%{_sbindir}/ipa-winsync-migrate
 %{_libexecdir}/certmonger/dogtag-ipa-ca-renew-agent-submit
 %{_libexecdir}/certmonger/ipa-server-guard
 %{_libexecdir}/ipa-otpd
@@ -688,6 +689,7 @@ fi
 %dir %{python_sitelib}/ipaserver/advise
 %dir %{python_sitelib}/ipaserver/advise/plugins
 %dir %{python_sitelib}/ipaserver/plugins
+%dir %{python_sitelib}/ipaserver/winsync_migrate
 %dir %{_libdir}/ipa/certmonger
 %attr(755,root,root) %{_libdir}/ipa/certmonger/*
 %dir %{_usr}/share/ipa
diff --git a/install/tools/Makefile.am b/install/tools/Makefile.am
index b791a8c748a18602f88522c3a0e3d74499700ae0..8c697748c51b25a131518f4082b30ec60d9c0fce 100644
--- a/install/tools/Makefile.am
+++ b/install/tools/Makefile.am
@@ -27,6 +27,7 @@ sbin_SCRIPTS =			\
 	ipa-restore		\
 	ipa-advise		\
 	ipa-cacert-manage	\
+	ipa-winsync-migrate	\
 	$(NULL)
 
 EXTRA_DIST =			\
diff --git a/setup.py b/setup.py
index af7964d601f811ca5371db4ae0b762e3b0f5238d..6438caaf56df6dedf2ddbe9a425910a4a6df30a6 100755
--- a/setup.py
+++ b/setup.py
@@ -84,6 +84,7 @@ setup(
 'ipaserver.plugins',
 'ipaserver.install',
 'ipaserver.install.plugins',
+'ipaserver.winsync_migrate',
 ],
 scripts=['ipa'],
 data_files = [('share/man/man1', ["ipa.1"])],
-- 
2.1.0

-- 
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

[Freeipa-devel] [PATCHES 306-316] Automated migration tool from Winsync

2015-03-09 Thread Tomas Babej

Hi,

this couple of patches provides a initial implementation of the winsync 
migration tool:


https://fedorahosted.org/freeipa/ticket/4524

Some parts could use some polishing, but this is a sound foundation.

Tomas

>From 9d8f6f2aef6662fcf4cc706a18d7857c34187481 Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Mon, 2 Mar 2015 16:30:56 +0100
Subject: [PATCH] winsync-migrate: Add initial plumbing

---
 install/tools/ipa-winsync-migrate | 23 
 ipaserver/winsync_migrate/__init__.py | 22 
 ipaserver/winsync_migrate/base.py | 67 +++
 3 files changed, 112 insertions(+)
 create mode 100755 install/tools/ipa-winsync-migrate
 create mode 100644 ipaserver/winsync_migrate/__init__.py
 create mode 100644 ipaserver/winsync_migrate/base.py

diff --git a/install/tools/ipa-winsync-migrate b/install/tools/ipa-winsync-migrate
new file mode 100755
index ..9eb9a03eb92396c855706e0f85850baece45b27e
--- /dev/null
+++ b/install/tools/ipa-winsync-migrate
@@ -0,0 +1,23 @@
+#! /usr/bin/python2 -E
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+from ipaserver.winsync_migrate.base import MigrateWinsync
+
+MigrateWinsync.run_cli()
diff --git a/ipaserver/winsync_migrate/__init__.py b/ipaserver/winsync_migrate/__init__.py
new file mode 100644
index ..e0da63db3a369adc4a34e8675471929b5839a812
--- /dev/null
+++ b/ipaserver/winsync_migrate/__init__.py
@@ -0,0 +1,22 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+"""
+Base subpackage for winsync-migrate related code.
+"""
diff --git a/ipaserver/winsync_migrate/base.py b/ipaserver/winsync_migrate/base.py
new file mode 100644
index ..c21a861c2e49b4ab6d9783c117d1e4de126cb0b6
--- /dev/null
+++ b/ipaserver/winsync_migrate/base.py
@@ -0,0 +1,67 @@
+# Authors: Tomas Babej 
+#
+# Copyright (C) 2015  Red Hat
+# see file 'COPYING' for use and warranty information
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+#
+
+import krbV
+import sys
+
+from ipalib import api
+from ipalib import errors
+from ipapython import admintool
+from ipapython.dn import DN
+from ipapython.ipa_log_manager import log_mgr
+from ipaserver.plugins.ldap2 import ldap2
+
+
+class MigrateWinsync(admintool.AdminTool):
+"""
+Tool to migrate winsync users.
+"""
+
+command_name = 'ipa-migrate-winsync'
+usage = "ipa-migrate-winsync"
+description = (
+"This tool creates user ID overrides for all the users "
+"that were previously synced from AD domain using the "
+"winsync replication agreement. It requires that trust "
+"with the AD forest has already been established and "
+"the users in question are resolvable using SSSD. "
+"For more information, see `man ipa-migrate-winsync`."
+)
+
+def run(self):
+super(MigrateWinsync, self).run()
+
+# Finaliz