-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9701 from mcalmer/issv3-align-custom-channels-at-…
…sync Issv3 align custom channels at sync
- Loading branch information
Showing
23 changed files
with
1,032 additions
and
94 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
47 changes: 47 additions & 0 deletions
47
java/code/src/com/redhat/rhn/taskomatic/task/GpgImportTask.java
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,47 @@ | ||
/* | ||
* Copyright (c) 2025 SUSE LLC | ||
* | ||
* 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. | ||
*/ | ||
package com.redhat.rhn.taskomatic.task; | ||
|
||
import com.suse.utils.CertificateUtils; | ||
|
||
import org.quartz.JobDataMap; | ||
import org.quartz.JobExecutionContext; | ||
import org.quartz.JobExecutionException; | ||
|
||
/** | ||
* Taskomatic task that import a GPG keys to the customer keyring | ||
* After saving the GPG key, the system configuration is refreshed. | ||
*/ | ||
public class GpgImportTask extends RhnJavaJob { | ||
|
||
@Override | ||
public String getConfigNamespace() { | ||
return "gpg-update"; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void execute(JobExecutionContext context) throws JobExecutionException { | ||
final JobDataMap jobDataMap = context.getJobDetail().getJobDataMap(); | ||
if (!jobDataMap.containsKey("gpg-key")) { | ||
log.error("No GPG key provided"); | ||
return; | ||
} | ||
try { | ||
CertificateUtils.importGpgKey((String)jobDataMap.get("gpg-key")); | ||
} | ||
catch (Exception e) { | ||
log.error("Importing the GPG key failed", e); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.