[packagedb-cli] Log debug the URL called before doing the call rather than after
by Pierre-YvesChibon
commit 628115ca59408a0511d1deea12d204bf89e8c8e6
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 15 16:15:04 2014 +0200
Log debug the URL called before doing the call rather than after
pkgdb2client.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pkgdb2client.py b/pkgdb2client.py
index ed7931b..7b2443e 100644
--- a/pkgdb2client.py
+++ b/pkgdb2client.py
@@ -95,6 +95,8 @@ class PkgDB(object):
:kwarg data: the data
'''
+ LOG.debug(
+ 'Calling: %s with arg: %s and data: %s', url, params, data)
req = self.session.request(
method=method,
url=url,
@@ -102,8 +104,6 @@ class PkgDB(object):
data=data,
verify=not self.insecure,
)
- LOG.debug(
- 'Called: %s with arg: %s and data: %s', req.url, params, data)
return req
@property
10 years
[packagedb-cli] Move get_critpath_packages to rely on the extras critpath endpoint
by Pierre-YvesChibon
commit b0b39e1769f2f0b4f55589a5bfa49bdec6aaac7d
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 15 11:10:07 2014 +0200
Move get_critpath_packages to rely on the extras critpath endpoint
The arguments to call this method have been simplified, now only one or
more branches are required.
The output will also differs as it returns a dictionary containing only
the package name in a very light-weight and fast fashion
pkgdb2client.py | 70 ++++++++++++++++++++++++++++--------------------------
1 files changed, 36 insertions(+), 34 deletions(-)
---
diff --git a/pkgdb2client.py b/pkgdb2client.py
index fc2489a..ed7931b 100644
--- a/pkgdb2client.py
+++ b/pkgdb2client.py
@@ -307,51 +307,53 @@ class PkgDB(object):
return output
- def get_critpath_packages(
- self, pattern='*', branches=None, status='Approved', acls=False,
- page=1, count=False):
- ''' Return the list of packages matching the provided criterias
- in the critical path.
+ def get_critpath_packages(self, branches=None, **kwargs):
+ ''' Return the list of package names in the critical path.
- To get information about what packages a person has acls on, you
- also need to call ``get_packager_acls``.
+ To get information about the ACL on the package, you
+ also need to call ``get_package``.
- :kwarg pattern: The pattern to match against the name of the
- packages
- :type pattern: str
:kwarg branches: One or more branches to restrict the packages
returned
:type branches: str or list or None
- :kwarg status: The status of the package to filter the packages
- returned, options are: ``Approved``, ``Orphaned``, ``Removed``,
- ``Retired``. Defaults to ``Approved``.
- :type status: str or list or None
- :kwarg acls: A boolean to return the package ACLs in the output.
- Beware, this may slow down you call considerably, maybe even
- leading to a timeout
- :type acls: bool
- :kwarg page: The page number to retrieve. If page is 0 or lower or
- equal to ``all`` then all pages are returned. Defaults to 0.
- :type page: int or ``all``
- :kwarg count: A boolean to retrieve the count of ACLs the user has
- instead of the details. If count is True the page argument will
- be ignored
- :type count: bool
:return: the json object returned by the API
:rtype: dict
:raise PkgDBException: if the API call does not return a http code
200.
+ Example of json returned
+
+ ::
+
+ {
+ "pkgs": {
+ "master": [
+ "rsyslog",
+ "pth",
+ "xorg-x11-server-utils",
+ "giflib"
+ ]
+ }
+ }
+
'''
- return self.get_packages(
- pattern=pattern,
- branches=branches,
- critpath=True,
- status=status,
- acls=acls,
- page=page,
- count=count,
- )
+ args = {
+ 'branches': branches,
+ 'format': 'json',
+ }
+
+ req = self.__send_request(
+ url='{0}/api/critpath/'.format(self.url),
+ method='GET',
+ params=args)
+
+ output = req.json()
+
+ if req.status_code != 200:
+ LOG.debug('full output %s', output)
+ raise PkgDBException(output['error'])
+
+ return output
def get_collections(self, pattern='*', clt_status=None):
''' Return the list of collections matching the provided criterias.
10 years
[packagedb-cli] Change the layout a bit for groups
by Pierre-YvesChibon
commit 9d702d40bdb4917a0ad247f42232aa9768407e0a
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 15 09:40:38 2014 +0200
Change the layout a bit for groups
pkgdb2_cli.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pkgdb2_cli.py b/pkgdb2_cli.py
index a012f62..5a507f0 100644
--- a/pkgdb2_cli.py
+++ b/pkgdb2_cli.py
@@ -414,7 +414,10 @@ def do_acl(args):
print "{0}ACLs:".format(" " * 8)
acls = _get_acls_info(pkg['acls'])
for user in acls:
- tmp = " " * 10 + user
+ if user.startswith('group::'):
+ tmp = " " * 3 + user
+ else:
+ tmp = " " * 10 + user
tmp = tmp + " " * (24 - len(tmp))
for acl_title in ["watchbugzilla", "watchcommits",
"commit", "approveacls"]:
10 years
[packagedb-cli] Do not called a variable that does not exist
by Pierre-YvesChibon
commit c893de0a1aec8dd6d0ed12a9279e6d2f1afd059f
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 15 09:40:06 2014 +0200
Do not called a variable that does not exist
Fixes https://fedorahosted.org/packagedb-cli/ticket/18
pkgdb2_cli.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/pkgdb2_cli.py b/pkgdb2_cli.py
index 83745ef..a012f62 100644
--- a/pkgdb2_cli.py
+++ b/pkgdb2_cli.py
@@ -423,7 +423,7 @@ def do_acl(args):
aclout = acls[user][acl_title]
tmp = tmp + aclout + " " * (16 - len(aclout))
else:
- tmp = tmp + aclout + " " * 8
+ tmp = tmp + " " * 16
if tmp is not None and tmp.strip() != "":
print tmp
10 years
[packagedb-cli] Replace the `devel` branch by `master` as it is in pkgdb2
by Pierre-YvesChibon
commit e52bc9a837e2f364e86ef587b931d1009010fce2
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Thu May 15 09:28:59 2014 +0200
Replace the `devel` branch by `master` as it is in pkgdb2
pkgdb2_cli.py | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/pkgdb2_cli.py b/pkgdb2_cli.py
index 73c2186..83745ef 100644
--- a/pkgdb2_cli.py
+++ b/pkgdb2_cli.py
@@ -170,7 +170,7 @@ def get_last_build(packagename, tag):
LOG.debug("Retrieve the last for {0} in {1}".format(packagename, tag))
# Add build information from koji
# for updates and updates-testing
- if tag == 'devel':
+ if tag == 'master':
tag = 'rawhide'
if "f" in tag:
tag = tag + "-updates"
@@ -220,8 +220,8 @@ def setup_parser():
help='Request acl for a given package')
parser_acl.add_argument('package', help="Name of the package to query")
parser_acl.add_argument(
- 'branch', default='devel', nargs="?",
- help="Branch of the package to query (default: 'devel', can be: "
+ 'branch', default='master', nargs="?",
+ help="Branch of the package to query (default: 'master', can be: "
"'all')")
parser_acl.add_argument(
'--pending', action="store_true", default=False,
@@ -272,8 +272,8 @@ def setup_parser():
'package',
help="Name of the package to orphan or simple pattern")
parser_orphan.add_argument(
- 'branch', default='devel', nargs="?",
- help="Branch of the package to orphan (default: 'devel', can be: "
+ 'branch', default='master', nargs="?",
+ help="Branch of the package to orphan (default: 'master', can be: "
"'all')")
parser_orphan.add_argument(
'--retire', action="store_true", default=False,
@@ -291,9 +291,9 @@ def setup_parser():
'package',
help="Name of the package to unorphan")
parser_unorphan.add_argument(
- 'branch', default='devel', nargs="?",
+ 'branch', default='master', nargs="?",
help="Branch of the package to unorphan "
- "(default: 'devel', can be: 'all')")
+ "(default: 'master', can be: 'all')")
parser_unorphan.add_argument(
'--all', action="store_true", default=False,
help="Unorphan all your packages")
@@ -320,9 +320,9 @@ def setup_parser():
" package (actions are '{0}', 'all')".format(
"', '".join(ACTIONLIST)))
parser_request.add_argument(
- 'branch', default='devel', nargs="?",
+ 'branch', default='master', nargs="?",
help="Branch of the package for which the ACL is "
- "requested (default: 'devel', can be: 'all')")
+ "requested (default: 'master', can be: 'all')")
parser_request.set_defaults(func=do_request)
## Update
@@ -340,9 +340,9 @@ def setup_parser():
help="FAS username of the person who requested ACL "
"on this package")
parser_update.add_argument(
- 'branch', default='devel', nargs="?",
+ 'branch', default='master', nargs="?",
help="Branch of the package for which the ACL is "
- "requested (default: 'devel', can be: 'all')")
+ "requested (default: 'master', can be: 'all')")
parser_update.add_argument(
'--approve', action="store_true", default=False,
help="Approve the requested ACL")
10 years
[packagedb-cli] Add classifiers to setup.py
by Pierre-YvesChibon
commit b1364d1aaf0f49fb0bdcabb9d8a07092a85136aa
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed May 14 23:45:59 2014 +0200
Add classifiers to setup.py
setup.py | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/setup.py b/setup.py
index de0d315..02b5bfa 100644
--- a/setup.py
+++ b/setup.py
@@ -22,5 +22,15 @@ setup(
"pkgdb-cli=pkgdb2_cli:main",
]
},
- install_requires=['requests', 'python-bugzilla', 'python-fedora']
+ install_requires=['requests', 'python-bugzilla', 'python-fedora'],
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Console',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Topic :: Software Development :: Libraries',
+ ],
)
10 years
[packagedb-cli] Created tag v2.1
by Pierre-YvesChibon
The signed tag 'v2.1' was created.
Tagger: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed May 14 23:35:09 2014 +0200
Release 2.1
Changes since the last tag 'v2.0.1':
Pierre-Yves Chibon (4):
Add method to retrieve packages marked as being in the critical path
Add the critpath filter to get_packages
Call directly get_packages instead of doing it manually and actually set the critpath flag
Bump to 2.0.1
Ralph Bean (1):
Fix typo reported by epienbroek.
10 years
[packagedb-cli: 2/2] Bump to 2.0.1
by Pierre-YvesChibon
commit af311417951497acc65c7f135b47cb3e9d4f67fa
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Wed May 14 23:32:15 2014 +0200
Bump to 2.0.1
pkgdb2client.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/pkgdb2client.py b/pkgdb2client.py
index 1e70913..fc2489a 100644
--- a/pkgdb2client.py
+++ b/pkgdb2client.py
@@ -23,7 +23,7 @@ import requests
logging.basicConfig()
LOG = logging.getLogger("pkgdb2client")
-__version__ = '2.0.1'
+__version__ = '2.1'
PKGDB_URL = r'https://admin.fedoraproject.org/pkgdb/'
10 years