Sha256: 1e7567da14da52e58be967bb5edd88c4a5d6d7874e5821152d78afa42d3f97c0

Contents?: true

Size: 1.23 KB

Versions: 12

Compression:

Stored size: 1.23 KB

Contents

#!/usr/bin/python
# Copyright (c) 2013-2016 SUSE LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 3 of the GNU General Public License as
# published by the Free Software Foundation.
#
# 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, contact SUSE LLC.
#
# To contact SUSE about this file by physical or electronic mail,
# you may find current contact information at www.suse.com

import yum
try:
  import json
except:
  import simplejson as json

yb = yum.YumBase()

repositories = []

for repo in yb.repos.sort():
  repo_dict = dict()
  repo_dict["alias"] = repo.id
  repo_dict["name"] = repo.name
  repo_dict["type"] = "rpm-md"
  repo_dict["url"] = repo.baseurl or []
  repo_dict["mirrorlist"] = repo.mirrorlist or ""
  repo_dict["enabled"] = repo.enabled
  repo_dict["gpgcheck"] = repo.gpgcheck
  repo_dict["gpgkey"] = repo.gpgkey
  repositories.append(repo_dict)

print(json.dumps(repositories))

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
machinery-tool-1.24.1 inspect_helpers/yum_repositories.py
machinery-tool-1.24.0 inspect_helpers/yum_repositories.py
machinery-tool-1.23.1 inspect_helpers/yum_repositories.py
machinery-tool-1.23.0 inspect_helpers/yum_repositories.py
machinery-tool-1.22.3 inspect_helpers/yum_repositories.py
machinery-tool-1.22.2 inspect_helpers/yum_repositories.py
machinery-tool-1.22.1 inspect_helpers/yum_repositories.py
machinery-tool-1.22.0 inspect_helpers/yum_repositories.py
machinery-tool-1.21.0 inspect_helpers/yum_repositories.py
machinery-tool-1.20.0 inspect_helpers/yum_repositories.py
machinery-tool-1.19.0 inspect_helpers/yum_repositories.py
machinery-tool-1.18.0 inspect_helpers/yum_repositories.py