Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SL Micro 6.0 tools for SUSE Manager #1651

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

Bischoff
Copy link
Contributor

What does this PR change?

Use different tools for Uyuni and SUSE Manager for SL Micro 6.0.

@Bischoff Bischoff force-pushed the slmicro6-tools-for-suma branch 3 times, most recently from ee7a634 to e774c4a Compare August 14, 2024 14:15
@Bischoff Bischoff marked this pull request as ready for review August 14, 2024 14:30
@Bischoff Bischoff changed the title WIP: SL Micro 6.0 tools for SUSE Manager SL Micro 6.0 tools for SUSE Manager Aug 14, 2024
@maximenoel8
Copy link
Contributor

maximenoel8 commented Aug 15, 2024

Maybe just one question, why are you creating is_uyuni variable and not just doing this ?

%{ if product_version contains "uyuni" }

or

 if [[ $product_version =~ uyuni ]]; then

@Bischoff
Copy link
Contributor Author

Bischoff commented Aug 15, 2024

Maybe just one question, why are you creating is_uyuni variable and not just doing this ?

%{ if product_version contains "uyuni" }

I do not see a "contains" operator in https://developer.hashicorp.com/terraform/language/expressions/operators

There is a strcontains() function (not operator) in recent terraforms, but not in the version we use.

or

 if [[ $product_version =~ uyuni ]]; then

The code above is shell, and product_version is a terraform variable.

You COULD pass the terraform variable to shell by using this

  if [[ "${{  product_version }}" =~ "uyuni" ]]; then

but this would get expanded to e.g.

  if [[ "4.3-stable" =~ "uyuni" ]]; then

which is not really elegant.

More discussions about my attempts here: https://suse.slack.com/archives/C02D12TNYLS/p1723642166193729

@Bischoff
Copy link
Contributor Author

Tested to work on suma-05 with both SUSE Manager and Uyuni products.

@nodeg
Copy link
Member

nodeg commented Aug 16, 2024

I can confirm the new changes work:

uyuni-min-sles15:~ # zypper lr --uri
Repository priorities are without effect. All enabled repositories share the same priority.

# | Alias              | Name               | Enabled | GPG Check | Refresh | URI
--+--------------------+--------------------+---------+-----------+---------+-------------------------------------------------------------------------------------------------------------------
1 | ca_suse            | ca_suse            | No      | ----      | ----    | http://download.opensuse.org/repositories/SUSE:/CA/15.5/
2 | client_tools_repo  | client_tools_repo  | No      | ----      | ----    | http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Master:/SLMicro6-Uyuni-Client-Tools/SL-Micro6/
3 | os_pool_repo       | os_pool_repo       | No      | ----      | ----    | http://download.suse.de/ibs/SUSE/Products/SL-Micro/6.0/x86_64/product/
4 | test_repo_rpm_pool | test_repo_rpm_pool | No      | ----      | ----    | http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Test-Packages:/Pool/rpm/
uyuni-min-sles15:~ #

uyuni-min-sles15:~ # salt-call --local grains.item product_version
/usr/lib/python3.11/site-packages/salt/utils/http.py:8: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi
/usr/lib/python3.11/site-packages/salt/utils/jinja.py:9: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
  import pipes
/usr/lib/python3.11/site-packages/salt/grains/core.py:2711: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
  ) = locale.getdefaultlocale()
local:
    ----------
    product_version:
        uyuni-master

@Bischoff Bischoff merged commit 7cd5a75 into uyuni-project:master Aug 16, 2024
2 checks passed
@Bischoff Bischoff deleted the slmicro6-tools-for-suma branch August 16, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants