|
|
|
@ -210,7 +210,7 @@ new file mode 100644 |
|
|
|
|
index 00000000..182f7190
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/plugins/subman/gsd-subman-helper.c
|
|
|
|
|
@@ -0,0 +1,378 @@
|
|
|
|
|
@@ -0,0 +1,372 @@
|
|
|
|
|
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
|
|
|
|
|
+ *
|
|
|
|
|
+ * Copyright (C) 2019 Richard Hughes <rhughes@redhat.com>
|
|
|
|
@ -477,9 +477,11 @@ index 00000000..182f7190 |
|
|
|
|
+ return G_IO_ERROR_NOT_FOUND;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* no options */
|
|
|
|
|
+ /* enable_content=1 auto attaches the subscription */
|
|
|
|
|
+ subman_options = g_variant_builder_new (G_VARIANT_TYPE("a{ss}"));
|
|
|
|
|
+
|
|
|
|
|
+ g_variant_builder_add (subman_options, "{ss}", "enable_content", "1");
|
|
|
|
|
+
|
|
|
|
|
+ /* set registration server */
|
|
|
|
|
+ if (hostname == NULL || hostname[0] == '\0')
|
|
|
|
|
+ hostname = g_strdup ("subscription.rhsm.redhat.com");
|
|
|
|
@ -578,17 +580,9 @@ index 00000000..182f7190 |
|
|
|
|
+ return G_IO_ERROR_NOT_INITIALIZED;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* wait for rhsmd to notice the new config */
|
|
|
|
|
+ g_usleep (G_USEC_PER_SEC * 5);
|
|
|
|
|
+
|
|
|
|
|
+ /* auto-attach */
|
|
|
|
|
+ if (!_helper_auto_attach (&error)) {
|
|
|
|
|
+ g_printerr ("Failed to AutoAttach: %s\n", error->message);
|
|
|
|
|
+ return G_IO_ERROR_NOT_INITIALIZED;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return EXIT_SUCCESS;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
diff --git a/plugins/subman/gsd-subscription-manager.c b/plugins/subman/gsd-subscription-manager.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 00000000..08b13fa6
|
|
|
|
|