Re: tiket #72

2009-03-12 Thread Dmitry Kolesov
Hello.
It is channges for the dispatcher.py. I added the function remove_user().


=== modified file 'pkgdb/dispatcher.py'
--- pkgdb/dispatcher.py 2009-02-27 15:58:55 +
+++ pkgdb/dispatcher.py 2009-03-13 01:20:10 +
@@ -1397,3 +1397,95 @@
 identity.current.user, [clone_branch])
 
 return dict(pkglisting=clone_branch)
+
+@expose(allow_json=True)

+# Check that the requestor is in a group that could potentially set ACLs.

+@identity.require(identity.not_anonymous())

+def remove_user(self, pkg_name, username, collectn_list=None):

+   '''Remove users from a package.
+:arg pkg_name: Name of the package
+:arg username: Name of user to remove from the package
+:arg collectn_list: list of collections like 'F-10', 'devel'
+'''

+person = fas.person_by_username(username)

+if not person:

+return dict(status=False,

+message='Specified user name %s does not have a' \

+' Fedora Account' % username)

+try:

+# pylint: disable-msg=E1101

+pkg = Package.query.filter_by(name=pkg_name).one()

+   except InvalidRequestError:

+   return dict(status=False, message='Package %s does not exist' % 
pkg_name)

+

+# Check that the current user is allowed to change acl statuses

+approved = self._user_can_set_acls(identity, pkg)

+if not ident.in_group('cvsadmin'):
+return dict(status=False, message=

+'%s is not allowed to remove user from the package' %

+identity.current.user_name)

+

+log_msgs = []

+

+   if collectn_list:

+   for simple_name in collectn_list:

+   try:

+   collectn = 
Collection.by_simple_name(simple_name)

+   except InvalidRequestError:

+   return dict(status=False, message='Collection 
%s does not exist' % simple_name)

+   

+pkg_listing = PackageListing.query.filter_by(packageid=pkg.id,

+  collectionid=collectn.id).one()

+ 

+acls = PersonPackageListingAcl.query.filter(and_(

+   PersonPackageListingAcl.c.personpackagelistingid

+   == PersonPackageListing.c.id,

+   PersonPackageListing.c.packagelistingid == 
pkg_listing.id,

+   PersonPackageListing.c.username == 
person['username'])).all()

+   

+for acl in acls:

+   person_acl = self._create_or_modify_acl(pkg_listing, 
person['id'], acl, self.obsoleteStatus)

+   

+   log_msg = u'%s has set the %s acl on %s (%s %s) to Obsolete 
for %s' % (

+identity.current.user_name, acl, pkg.name,

+pkg_listing.collection.name, 
pkg_listing.collection.version, 

+person['username'])

+   log = PersonPackageListingAclLog(identity.current.user.id,

+self.obsoleteStatus.statuscodeid, log_msg)

+   log.acl = person_acl # pylint: disable-msg=W0201

+   log_msgs.append(log_msg)

+

+   else:

+for pkg_listing in pkg.listings:

+   acls = PersonPackageListingAcl.query.filter(and_(

+   PersonPackageListingAcl.c.personpackagelistingid

+   == PersonPackageListing.c.id,

+   PersonPackageListing.c.packagelistingid == 
pkg_listing.id,

+   PersonPackageListing.c.username == 
person['username'])).all()

+

+for acl in acls:

+person_acl = self._create_or_modify_acl(pkg_listing, 
person['id'], acl, self.obsoleteStatus)

+

+log_msg = u'%s has set the %s acl on %s (%s %s) to 
Obsolete for %s' % (

+identity.current.user_name, acl, pkg.name,

+pkg_listing.collection.name, 
pkg_listing.collection.version, 

+person['username'])

+log = PersonPackageListingAclLog(identity.current.user.id,

+self.obsoleteStatus.statuscodeid, log_msg)

+log.acl = person_acl # pylint: disable-msg=W0201

+log_msgs.append(log_msg)

+

+try:

+session.flush()

+except SQLError, e:

+# An error was generated

+return dict(status=False,

+message='Not able to change acl %s on %s with status %s' \

+% (acl, pkgid, 

Re: tiket #86

2009-02-21 Thread Dmitry Kolesov
Hello Toshio.
It is channges for the pkgdb-client what I did if I understood You right:


200c200,203
 pkgdb.clone_branch(package, branch, options.masterBranch)
---
   if options.masterBranch:
   pkgdb.clone_branch(package, branch, 
 options.masterBranch)
   else:
   pkgdb.clone_branch(package, branch, 'devel')

-Dmitry
200c200,203
 pkgdb.clone_branch(package, branch, options.masterBranch)
---
 		if options.masterBranch:
 		pkgdb.clone_branch(package, branch, options.masterBranch)
 		else:
 			pkgdb.clone_branch(package, branch, 'devel')
___
Fedora-infrastructure-list mailing list
Fedora-infrastructure-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-infrastructure-list


Re: Introduction

2009-02-16 Thread Dmitry Kolesov
 On Sat, 2009-02-14, Mike McGrath wrote:
 Hello Dmitry, have you seen our getting started page?

Hello Mike.

Yes, I have seen your getting started page.
I subscribed to the fedora-infrastructure-list@redhat.com, 
signed up for a Fedora Account and sent an introduction with some notes about 
myself.
May be I have done something wrong?

-Dmitry

___
Fedora-infrastructure-list mailing list
Fedora-infrastructure-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-infrastructure-list


Re: Introduction

2009-02-16 Thread Dmitry Kolesov
Mike McGrath wrote:
 On Mon, 16 Feb 2009, Dmitry Kolesov wrote:
 
   On Sat, 2009-02-14, Mike McGrath wrote:
   Hello Dmitry, have you seen our getting started page?
 
  Hello Mike.
 
  Yes, I have seen your getting started page.
  I subscribed to the fedora-infrastructure-list@redhat.com,
  signed up for a Fedora Account and sent an introduction with some notes 
  about myself.
  May be I have done something wrong?
 
 
 Nope, just checking.  What is your FAS username?
 
   -Mike
 

My account name in FAS is kolesovdv.

 -Dmitry

___
Fedora-infrastructure-list mailing list
Fedora-infrastructure-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-infrastructure-list


Re: Introduction

2009-02-16 Thread Dmitry Kolesov
On Tue, 17 Feb 2009, Mike McGrath wrote:

 On Tue, 17 Feb 2009, Dmitry Kolesov wrote:
 
  Mike McGrath wrote:
   On Mon, 16 Feb 2009, Dmitry Kolesov wrote:
  
 On Sat, 2009-02-14, Mike McGrath wrote:
 Hello Dmitry, have you seen our getting started page?
   
Hello Mike.
   
Yes, I have seen your getting started page.
I subscribed to the fedora-infrastructure-list@redhat.com,
signed up for a Fedora Account and sent an introduction with some notes 
about myself.
May be I have done something wrong?
   
  
   Nope, just checking.  What is your FAS username?
  
 -Mike
  
 
  My account name in FAS is kolesovdv.
 
 
 Make sure to apply for the sysadmin group.  Be warned though, nagios
 alerts will start coming to you.
 
   -Mike

I have applied  for the sysadmin group, and while my status is unapproved. 

 -Dmitry

___
Fedora-infrastructure-list mailing list
Fedora-infrastructure-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-infrastructure-list


Introduction

2009-02-13 Thread Dmitry Kolesov
Hello.
I am sorry for my last message, coding was wrong.
And I deside to send it again.

My name is Dmitry Kolesov and I would like 
to join the Infrastructure group.

I have been a Linux sysadmin for several years.
And I have experience with bash, Python, C/C++, PHP, MySQL, PostgreSQL.
I have workstations with Fedora and CentOS in my work.
I think I  can help.

Best regardes.

___
Fedora-infrastructure-list mailing list
Fedora-infrastructure-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-infrastructure-list