There are many Services in Fedora. Many of these have an interface that we can query and get back information as JSON data. There is documentation here about both the services and the client modules that can access them.
FAS is the Fedora Account System. It holds the account data for all of our contributors.
An object for querying the Fedora Account System.
The Account System object provides a python API for talking to the Fedora Account System. It abstracts the http requests, cookie handling, and other details so you can concentrate on the methods that are important to your program.
Return the config entry for the key values.
Parameters: |
|
---|---|
Raises AppError: | |
if the server returns an exception |
|
Returns: | The unicode string that describes the value. If no entry matched the username, application, and attribute then None is returned. |
Return the config entries that match the keys and the pattern.
Note: authentication on the server will prevent anyone but the user or a fas admin from viewing or changing their configs.
Parameters: |
|
---|---|
Raises AppError: | |
if the server returns an exception |
|
Returns: | A dict mapping attribute to value. |
Returns a group object based on its id
Returns a group object based on its name
Return administrators/sponsors/users and group type for all groups
Parameters: | force_refresh – If true, the returned data will be queried from the database, as opposed to memcached. |
---|---|
Raises AppError: | |
if the query failed on the server | |
Returns: | A dict mapping group names to the group type and the user IDs of the administrator, sponsors, and users of the group. |
New in version 0.3.8.
Return a list of people approved for a group.
This method returns a list of people who are in the requested group. The people are all approved in the group. Unapproved people are not shown. The format of data is:
\[{'username': 'person1', 'role_type': 'user'},
\{'username': 'person2', 'role_type': 'sponsor'}]
role_type can be one of ‘user’, ‘sponsor’, or ‘administrator’.
New in version 0.3.2.
Changed in version 0.3.21: Return a Bunch instead of a DictContainer
Return a list of persons for the given groupname.
Parameters: | groupname – Name of the group to look up |
---|---|
Returns: | A list of person objects from the group. If the group contains no entries, then an empty list is returned. |
Deprecated Use people_by_key() instead.
Returns a dict relating user IDs to human_name, email, username, and bugzilla email
Changed in version 0.3.21: Return a Bunch instead of a DictContainer
Return a dict of people
Parameters: |
|
---|---|
Returns: | a dict relating the key value to the fields. |
Changed in version 0.3.21: Return a Bunch instead of a DictContainer
Changed in version 0.3.26: Fixed to return a list with both people who have signed the CLA and have not
Returns a list of dicts representing database rows
Parameters: |
|
---|---|
Raises AppError: | |
if the query failed on the server (most likely because the server was given a bad query) |
|
Returns: | A list of dicts representing database rows (the keys of the dict are the columns requested) |
New in version 0.3.12.1.
Returns a person object based on its id
Returns a person object based on its username
Set a config entry in FAS for the user.
Note: authentication on the server will prevent anyone but the user or a fas admin from viewing or changing their configs.
Parameters: |
|
---|---|
Raises AppError: | |
if the server returns an exception |
Return user data for all users in FAS
Note: If the user is not authorized to see password hashes, ‘*’ is returned for the hash.
Raises AppError: | |
---|---|
if the query failed on the server | |
Returns: | A dict mapping user IDs to a username, password hash, SSH public key, email address, and status. |
New in version 0.3.8.
Generate a cert for a user
Returns a dict relating user IDs to usernames
Return whether the username and password pair are valid.
Parameters: |
|
---|---|
Returns: | True if the username/password are valid. False otherwise. |
The Package Database holds information about packages in Fedora. It currently has a developer-centric view of packages that concentrates on who the owner is of a particular package.
Plans to add an end-user view to packages is ongoing.
Changed in version 0.3.21: Added PackageDB.add_comaintainers() Added PackageDB.change_owner()
Add comaintainers to all packagelistings that the owner either is the owner or has approveacls on. Then email comaintainers/owners on those packages that the maintainer has changed the acls.
Parameters: |
|
---|
New in version 0.3.21.
Add a package to the database.
Parameters: |
|
---|---|
Raises AppError: | |
If the server returns an error |
New in version 0.3.13.
Return collection branch information from the packagedb.
This method caches the branch information from the packagedb in self._branches. It returns that information when called.
Parameters: | refresh – If refresh is set to True, contact the server even if the information was previously cached |
---|---|
Returns: | dictionary of branches keyed by their shortname |
Change a branch abbreviation into a name and version.
Parameters: | branch – branch abbreviation |
---|---|
Return type: | tuple |
Returns: | tuple of branch name and branch version. |
Example: >>> name, version = canonical_branch_name(‘FC-6’) >>> name Fedora >>> version 6
Change the owner of all packagelistings that the owner either is the owner or has approveacls on. Then email comaintainers/owners on those packages that the owner has changed the owner.
Parameters: |
|
---|
New in version 0.3.21.
Set a branch’s permissions from a pre-existing branch.
Parameters: |
|
---|---|
Raises AppError: | |
If the server returns an exceptiom |
Edit a package.
Parameters: |
|
---|---|
Raises AppError: | |
If the server returns an error |
This method takes information about a package and either edits the package to reflect the changes to information.
Note: This method will be going away in favor of methods that do smaller chunks of work:
New in version 0.3.13.
Return the package attributes used by bugzilla.
Return type: | Bunch |
---|---|
Returns: | Bunch contains information needed to setup bugzilla
for every collection. It looks like this:
data[collctn][pkg][attribute] where attribute is one of:
:owner: FAS username for the owner
:qacontact: if the package hasa special qacontact, their userid is listed here
:summary: Short description of the package
:cclist: list of FAS userids that are watching the package
|
New in version 0.3.15.
Changed in version 0.3.21: Return Bunch instead of DictContainer
Retrieve a list of all collections.
Parameters: | eol – Default True. If set to False, do not return collections marked eol. |
---|---|
Returns: | list of collections |
Return names of packages marked critical path.
Parameters: | collctn_list – When set to a list of Collection names, only retrieve packages which are marked critpath in any of the collections. Defaults to retrieving critpath packages in all non-EOL releases |
---|---|
Return type: | Bunch |
Returns: | Keys of the returned dict are collection simple names. The values are lists of package names that are marked critpath |
New in version 0.3.17.
Changed in version 0.3.21: Return Bunch instead of DictContainer
Return the package attibutes used by notify
Parameters: |
|
---|---|
Return type: | Bunch |
Returns: | Bunch keyed on package name. Each entry has a list of people to be notified for this package. |
New in version 0.3.15.
Changed in version 0.3.21: Return Bunch instead of DictContainer
Retrieve the ownership information for a package.
Parameters: |
|
---|---|
Kward collection_ver: | |
old/deprecated argument; use collctn_ver |
|
Raises AppError: | |
If the server returns an error |
|
Return type: | Bunch |
Returns: | dict of ownership information for the package |
Changed in version 0.3.17: Rename collection and collection_ver to collctn_name and collctn_ver
Changed in version 0.3.21: Return Bunch instead of DictContainer
Get information about the package.
Parameters: |
|
---|---|
Raises AppError: | |
If the server returns an exceptiom |
|
Returns: | Package ownership information |
Return type: | Bunch |
Changed in version 0.3.21: Return Bunch instead of DictContainer
Retrieve a list of all package names in a collection.
Parameters: |
|
---|---|
Returns: | list of package names present in the collection. |
New in version 0.3.15.
Changed in version 0.3.17: Rename collectn to collctn
Return the acls for the version control system.
Note: the return values from this function will be changing when the PackageDB updates to 0.5.x. The return data will look like this:
data[pkg][branch].people
data[pkg][branch].groups
Return type: | Bunch |
---|---|
Returns: | Bunch representing the vcs acls for every person.
It looks like this: data[pkg][branch][‘commit’].people list of
users who can commit to the package. Example:>>> print data['bzr']['devel']['commit'].people
['toshio', 'hno', 'shahms', 'toshio']
>>> print data['bzr']['devel']['commit'].groups
['provenpackager']
|
New in version 0.3.15.
Changed in version 0.3.21: Return Bunch instead of DictContainer
Branch all unblocked packages for a new release.
Mass branching always works against the devel branch.
Parameters: | branch – Branch name to create branches for. Names are listed in COLLECTIONMAP |
---|---|
Raises AppError: | |
If the server returns an exceptiom. The ‘extras’ attribute will contain a list of unbranched packages if some of the packages were branched |
List the packages which are orphaned
Returns: | List of pkgs which are orphaned in any non-EOL release. |
---|
Remove user from a package
Parameters: |
|
---|---|
Returns: | status code from the request |
New in version 0.3.12.
Changed in version 0.3.17: Rename collectn_list to collctn_list
Mark packages as being in the critical path.
Critical path packages are subject to more testing or stringency of criteria for updating when a release occurs.
Parameters: |
|
---|
New in version 0.3.17.
Retrieve information about the packages a user owns
Parameters: |
|
---|---|
Returns: | packages that the user has acls on |
New in version 0.3.14.
Bodhi is used to push updates from the build system to the download repositories. It lets packagers send packages to the testing repository or to the update repository.
Get a list list of update candidates.
This method is a generator that returns a list of koji builds that could potentially be pushed as updates.
Add a comment to an update.
Parameters: |
|
---|
Delete an update.
Parameters: | update – The title of the update to delete |
---|
Return an authenticated koji session
Return a list of bodhi releases.
This method returns a dictionary in the following format:
{"releases": [
{"dist_tag": "dist-f12", "id_prefix": "FEDORA",
"locked": false, "name": "F12", "long_name": "Fedora 12"}]}
Return an authenticated koji session
Get a list of the latest builds for this package.
Parameters: | package – package name to find builds for. |
---|---|
Returns: | a dictionary of the release dist tag to the latest build. |
New in version 0.3.2.
Return the status of bodhi’s masher
Parse an update template file.
Parameters: | input_file – The filename of the update template. |
---|
Returns an array of dictionaries of parsed update values which can be directly passed to the save method.
Return a list of requests
Push a list of updates.
Parameters: | updates – A list of update titles to push. |
---|
Query bodhi for a list of updates.
Parameters: |
|
---|
Request an update state change.
Parameters: |
|
---|
Save an update.
This entails either creating a new update, or editing an existing one. To edit an existing update, you must specify the update title in the edited keyword argument.
Parameters: |
|
---|
Get a list of installed testing updates.
This method is a generate that yields packages that you currently have installed that you have yet to test and provide feedback for.
Return a string representation of a given update dictionary.
Parameters: |
|
---|