-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide DBus objects for configuration, facts, and registration.
This commit creates DBus objects off the com.redhat.RHSM1 namespace. Objects include Facts which is meant to gather all the relevant system facts, Config which gives access to the subscription-manager configuration settings, and RegisterServer which opens a domain socket with another DBus object listening to allow for system registration. The indirection over the domain socket is so that credentials will be passed securely from one process to another instead of going over the system bus. This commit also retrofits the main subscription-manager code to use the Facts and Config objects.
- Loading branch information
Showing
123 changed files
with
5,884 additions
and
780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#! /usr/bin/env python | ||
# | ||
# Copyright (c) 2016 Red Hat, Inc. | ||
# | ||
# This software is licensed to you under the GNU General Public License, | ||
# version 2 (GPLv2). There is NO WARRANTY for this software, express or | ||
# implied, including the implied warranties of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | ||
# along with this software; if not, see | ||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
# | ||
# Red Hat trademarks are not licensed under GPLv2. No permission is | ||
# granted to use or replicate Red Hat trademarks that are incorporated | ||
# in this software or its documentation. | ||
# | ||
import logging | ||
|
||
# Init logging very early so we can log any issues that occur at import time | ||
logging.basicConfig(level=logging.DEBUG, format="%(levelname)5s [%(name)s:%(lineno)s] %(message)s") | ||
log = logging.getLogger('') | ||
log.setLevel(logging.INFO) | ||
|
||
import sys | ||
from rhsmlib.dbus import service_wrapper | ||
from rhsmlib.dbus.facts import base, constants | ||
|
||
if __name__ == "__main__": | ||
try: | ||
object_classes = [ | ||
base.AllFacts, | ||
] | ||
sys.exit(service_wrapper.main( | ||
sys.argv, | ||
object_classes=object_classes, | ||
default_bus_name=constants.FACTS_DBUS_NAME) | ||
) | ||
except Exception: | ||
log.exception("DBus service startup failed") | ||
else: | ||
# Importing this module would screw up the importer's logging configuration since | ||
# we're setting up logging very early in module scope to catch any log messages that | ||
# occur during the loading of the dependent modules. | ||
raise ImportError("This module is not meant to be imported") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env python | ||
# | ||
# Copyright (c) 2016 Red Hat, Inc. | ||
# | ||
# This software is licensed to you under the GNU General Public License, | ||
# version 2 (GPLv2). There is NO WARRANTY for this software, express or | ||
# implied, including the implied warranties of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 | ||
# along with this software; if not, see | ||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
# | ||
# Red Hat trademarks are not licensed under GPLv2. No permission is | ||
# granted to use or replicate Red Hat trademarks that are incorporated | ||
# in this software or its documentation. | ||
# | ||
import logging | ||
|
||
# Init logging very early so we can log any issues that occur at import time | ||
logging.basicConfig(level=logging.DEBUG, format="%(levelname)5s [%(name)s:%(lineno)s] %(message)s") | ||
log = logging.getLogger('') | ||
log.setLevel(logging.INFO) | ||
|
||
import sys | ||
from rhsmlib.dbus import service_wrapper | ||
from rhsmlib.dbus import objects | ||
|
||
if __name__ == "__main__": | ||
try: | ||
object_classes = [ | ||
objects.ConfigDBusObject, | ||
objects.RegisterDBusObject, | ||
objects.Main | ||
] | ||
sys.exit(service_wrapper.main(sys.argv, object_classes=object_classes)) | ||
except Exception: | ||
log.exception("DBus service startup failed") | ||
else: | ||
# Importing this module would screw up the importer's logging configuration since | ||
# we're setting up logging very early in module scope to catch any log messages that | ||
# occur during the loading of the dependent modules. | ||
raise ImportError("This module is not meant to be imported") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
-r test-requirements.txt | ||
yanc | ||
nose-randomly | ||
xtraceback |
Oops, something went wrong.