Change repo.saltproject.io to new url

This commit is contained in:
twangboy 2024-10-31 09:52:00 -06:00 committed by Daniel Wozniak
parent 6f387ded58
commit 79d4ff772a
17 changed files with 168 additions and 286 deletions

View file

@ -94,7 +94,9 @@ for more information.
To download and install Salt, see:
* `The Salt install guide <https://docs.saltproject.io/salt/install-guide/en/latest/index.html>`_
* `Salt Project repository <https://repo.saltproject.io/>`_
* `Salt Project repository <https://packages.broadcom.com/artifactory/saltproject-generic/>`_
* `Salt Project debian repository <https://packages.broadcom.com/artifactory/saltproject-deb/>`_
* `Salt Project redhat repository <https://packages.broadcom.com/artifactory/saltproject-rpm/>`_
Technical support

View file

@ -163,16 +163,11 @@
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="nav navbar-nav">
<li><a href="/en/latest/">Overview</a></li>
<li><a href="https://docs.saltproject.io/salt/user-guide/en/latest/">Salt User Guide</a></li>
<li><a href="/en/latest/contents.html">Documentation</a></li>
<li><a href="https://repo.saltproject.io">Downloads</a></li>
<li><a href="/en/latest/topics/development/">Develop</a></li>
<!--<li><a href="/en/2016.3/faq/">FAQ</a></li>
<li><a href="/en/2016.3/samples/">Code Samples</a></li>-->
<!-- <li><a href="https://repo.saltproject.io" target="_blank">Downloads</a></li>-->
<!--<li><a href="http://saltstack.com/training" target="_blank">Training</a></li>
<li><a href="http://saltstack.com/support" target="_blank">Support</a></li>-->
<li><a href="/en/latest/">Overview</a></li>
<li><a href="https://docs.saltproject.io/salt/user-guide/en/latest/">Salt User Guide</a></li>
<li><a href="/en/latest/contents.html">Documentation</a></li>
<li><a href="https://packages.broadcom.com/artifactory/saltproject-generic/">Downloads</a></li>
<li><a href="/en/latest/topics/development/">Develop</a></li>
</ul>
</div>
</div>

View file

@ -184,17 +184,17 @@ rst_prolog = """\
.. |windownload| raw:: html
<p>Python3 x86: <a
href="https://repo.saltproject.io/windows/Salt-Minion-{release}-Py3-x86-Setup.exe"><strong>Salt-Minion-{release}-x86-Setup.exe</strong></a>
| <a href="https://repo.saltproject.io/windows/Salt-Minion-{release}-Py3-x86-Setup.exe.md5"><strong>md5</strong></a></p>
href="https://packages.broadcom.com/artifactory/saltproject-generic/windows/{release}/Salt-Minion-{release}-Py3-x86-Setup.exe"><strong>Salt-Minion-{release}-x86-Setup.exe</strong></a>
| <a href="https://packages.broadcom.com/artifactory/saltproject-generic/windows/{release}/Salt-Minion-{release}-Py3-x86-Setup.exe.md5"><strong>md5</strong></a></p>
<p>Python3 AMD64: <a
href="https://repo.saltproject.io/windows/Salt-Minion-{release}-Py3-AMD64-Setup.exe"><strong>Salt-Minion-{release}-AMD64-Setup.exe</strong></a>
| <a href="https://repo.saltproject.io/windows/Salt-Minion-{release}-Py3-AMD64-Setup.exe.md5"><strong>md5</strong></a></p>
href="https://packages.broadcom.com/artifactory/saltproject-generic/windows/{release}/Salt-Minion-{release}-Py3-AMD64-Setup.exe"><strong>Salt-Minion-{release}-AMD64-Setup.exe</strong></a>
| <a href="https://packages.broadcom.com/artifactory/saltproject-generic/windows/{release}/Salt-Minion-{release}-Py3-AMD64-Setup.exe.md5"><strong>md5</strong></a></p>
.. |osxdownloadpy3| raw:: html
<p>x86_64: <a href="https://repo.saltproject.io/osx/salt-{release}-py3-x86_64.pkg"><strong>salt-{release}-py3-x86_64.pkg</strong></a>
| <a href="https://repo.saltproject.io/osx/salt-{release}-py3-x86_64.pkg.md5"><strong>md5</strong></a></p>
<p>x86_64: <a href="https://packages.broadcom.com/artifactory/saltproject-generic/macos/{release}/salt-{release}-py3-x86_64.pkg"><strong>salt-{release}-py3-x86_64.pkg</strong></a>
| <a href="https://packages.broadcom.com/artifactory/saltproject-generic/macos/{release}/salt-{release}-py3-x86_64.pkg.md5"><strong>md5</strong></a></p>
""".format(
release=stripped_release

View file

@ -146,10 +146,8 @@ Before installing the delta proxy minion, ensure that:
Install or upgrade Salt
-----------------------
Ensure your Salt masters are running at least Salt version 3004. For instructions
on installing or upgrading Salt, see `repo.saltproject.io
<http://repo.saltproject.io/>`_. For RedHat systems, see `Install or Upgrade Salt
<https://enterprise.saltproject.io/en/latest/docs/install-salt.html>`_.
on installing or upgrading Salt, see the `Salt install guide
<https://docs.saltproject.io/salt/install-guide>`_.
.. _delta-proxy-install:

View file

@ -62,7 +62,7 @@ from saltstack.com:
* `SaltStack Download Area`__
.. __: https://repo.saltproject.io/windows/
.. __: https://packages.broadcom.com/artifactory/saltproject-generic/windows/
.. _new-pywinrm:

View file

@ -124,8 +124,8 @@ def _sync(form, saltenv=None, extmod_whitelist=None, extmod_blacklist=None):
def update(version=None):
"""
Update the salt minion from the URL defined in opts['update_url']
VMware, Inc provides the latest builds here:
update_url: https://repo.saltproject.io/windows/
Broadcom, Inc provides the latest builds here:
update_url: https://packages.broadcom.com/artifactory/saltproject-generic/windows/
Be aware that as of 2014-8-11 there's a bug in esky such that only the
latest version available in the update_url can be downloaded and installed.

View file

@ -769,7 +769,7 @@ def bootstrap_psexec(
installer_url
URL of minion installer executable. Defaults to the latest version from
https://repo.saltproject.io/windows/
https://packages.broadcom.com/artifactory/saltproject-generic/windows/
username
Optional user name for login on remote computer.
@ -787,6 +787,9 @@ def bootstrap_psexec(
salt-run manage.bootstrap_psexec hosts='host1,host2' installer_url='http://exampledomain/salt-installer.exe'
"""
# TODO: Need to make this gets the latest version from the new repo location
# TODO: Similar to tests/support/win_installer.py
# TODO: Maybe need to move that ^^^^ to a salt util
if not installer_url:
base_url = "https://repo.saltproject.io/windows/"
source = urllib.request.urlopen(base_url).read()

View file

@ -99,17 +99,17 @@ Using ``aptkey: False`` with ``key_url`` example:
.. code-block:: yaml
deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch=amd64] https://repo.saltproject.io/py3/ubuntu/18.04/amd64/latest bionic main:
deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch=amd64] https://packages.broadcom.com/artifactory/saltproject-deb/ bionic main:
pkgrepo.managed:
- file: /etc/apt/sources.list.d/salt.list
- key_url: https://repo.saltproject.io/py3/ubuntu/18.04/amd64/latest/salt-archive-keyring.gpg
- key_url: https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
- aptkey: False
Using ``aptkey: False`` with ``keyserver`` and ``keyid``:
.. code-block:: yaml
deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch=amd64] https://repo.saltproject.io/py3/ubuntu/18.04/amd64/latest bionic main:
deb [signed-by=/etc/apt/keyrings/salt-archive-keyring.gpg arch=amd64] https://packages.broadcom.com/artifactory/saltproject-deb/ bionic main:
pkgrepo.managed:
- file: /etc/apt/sources.list.d/salt.list
- keyserver: keyserver.ubuntu.com

View file

@ -231,10 +231,15 @@ class CPModuleTest(ModuleCase):
"""
cp.get_url with https:// source given
"""
self.run_function("cp.get_url", ["https://www.broadcom.com", tgt])
self.run_function(
"cp.get_url",
["https://packages.broadcom.com/artifactory/saltproject-generic/", tgt],
)
with salt.utils.files.fopen(tgt, "r") as instructions:
data = salt.utils.stringutils.to_unicode(instructions.read())
self.assertIn("Broadcom Inc. is a global technology leader", data)
self.assertIn("Index of saltproject", data)
self.assertIn("onedir", data)
self.assertIn("Artifactory Online Server", data)
self.assertNotIn("AYBABTU", data)
@pytest.mark.slow_test
@ -242,11 +247,16 @@ class CPModuleTest(ModuleCase):
"""
cp.get_url with https:// source given and destination omitted.
"""
ret = self.run_function("cp.get_url", ["https://www.broadcom.com"])
ret = self.run_function(
"cp.get_url",
["https://packages.broadcom.com/artifactory/saltproject-generic/"],
)
with salt.utils.files.fopen(ret, "r") as instructions:
data = salt.utils.stringutils.to_unicode(instructions.read())
self.assertIn("Broadcom Inc. is a global technology leader", data)
self.assertIn("Index of saltproject", data)
self.assertIn("onedir", data)
self.assertIn("Artifactory Online Server", data)
self.assertNotIn("AYBABTU", data)
@pytest.mark.slow_test
@ -259,13 +269,20 @@ class CPModuleTest(ModuleCase):
sleep = 5
tgt = None
while time.time() - start <= timeout:
ret = self.run_function("cp.get_url", ["https://www.broadcom.com", tgt])
ret = self.run_function(
"cp.get_url",
["https://packages.broadcom.com/artifactory/saltproject-generic/", tgt],
)
if ret.find("HTTP 599") == -1:
break
time.sleep(sleep)
if ret.find("HTTP 599") != -1:
raise Exception("https://www.broadcom.com returned 599 error")
self.assertIn("Broadcom Inc. is a global technology leader", ret)
raise Exception(
"https://packages.broadcom.com/artifactory/saltproject-generic/ returned 599 error"
)
self.assertIn("Index of saltproject", ret)
self.assertIn("onedir", ret)
self.assertIn("Artifactory Online Server", ret)
self.assertNotIn("AYBABTU", ret)
@pytest.mark.slow_test
@ -334,9 +351,11 @@ class CPModuleTest(ModuleCase):
"""
cp.get_file_str with https:// source given
"""
src = "https://www.broadcom.com"
src = "https://packages.broadcom.com/artifactory/saltproject-generic/"
ret = self.run_function("cp.get_file_str", [src])
self.assertIn("Broadcom Inc. is a global technology leader", ret)
self.assertIn("Index of saltproject", ret)
self.assertIn("onedir", ret)
self.assertIn("Artifactory Online Server", ret)
self.assertNotIn("AYBABTU", ret)
@pytest.mark.slow_test

View file

@ -104,7 +104,7 @@ def build_repo_file():
source_path = "/etc/apt/sources.list.d/source_test_list.list"
try:
test_repos = [
"deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://repo.saltproject.io/salt/py3/ubuntu/22.04/amd64/latest jammy main",
"deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://packages.broadcom.com/artifactory/saltproject-deb/ jammy main",
"deb http://dist.list stable/all/",
]
with salt.utils.files.fopen(source_path, "w+") as fp:

View file

@ -135,12 +135,8 @@ def test_mod_del_repo(grains, modules):
elif grains["os_family"] == "RedHat":
repo = "saltstack"
name = "SaltStack repo for RHEL/CentOS {}".format(grains["osmajorrelease"])
baseurl = "https://repo.saltproject.io/py3/redhat/{}/x86_64/latest/".format(
grains["osmajorrelease"]
)
gpgkey = "https://repo.saltproject.io/py3/redhat/{}/x86_64/latest/SALTSTACK-GPG-KEY.pub".format(
grains["osmajorrelease"]
)
baseurl = "https://packages.broadcom.com/artifactory/saltproject-rpm/"
gpgkey = "https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public"
gpgcheck = 1
enabled = 1
ret = modules.pkg.mod_repo(

View file

@ -661,8 +661,8 @@ class Repo:
@alt_repo.default
def _default_alt_repo(self):
"""
Use an alternative repo, packages do not
exist for the OS on repo.saltproject.io
Use an alternative repo, packages do not exist for the OS on
packages.broadcom.com
"""
if (
self.grains["osfullname"] == "Ubuntu"
@ -690,7 +690,7 @@ class Repo:
@repo_url.default
def _default_repo_url(self):
return f"https://repo.saltproject.io/py3/{self.fullname}/{self.grains['osrelease']}/{self.grains['osarch']}/latest"
return "https://packages.broadcom.com/artifactory/saltproject-deb/"
@repo_content.default
def _default_repo_content(self):
@ -863,7 +863,7 @@ def test_adding_repo_file_signedby_alt_file(pkgrepo, states, repo):
assert repo.repo_content in ret.comment
key_file = repo.key_file.parent / "salt-alt-key.gpg"
repo_content = "deb [arch=amd64 signed-by={}] https://repo.saltproject.io/py3/debian/10/amd64/latest buster main".format(
repo_content = "deb [arch=amd64 signed-by={}] https://packages.broadcom.com/artifactory/saltproject-deb/ buster main".format(
str(key_file)
)
ret = states.pkgrepo.managed(
@ -925,7 +925,7 @@ def test_adding_repo_file_signedby_fail_key_keyurl(
name=repo.repo_content,
file=str(repo.repo_file),
clean_file=True,
key_url="https://repo.saltproject.io/salt/py3/ubuntu/20.04/amd64/latest/SALT-PROJECT-GPG-PUBKEY-2023.pub",
key_url="https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public",
aptkey=False,
)

View file

@ -150,7 +150,7 @@ def test_shell_inject_ssh_priv(
"""
# ZDI-CAN-11143
path = tmp_path / "test-11143"
tgts = ["repo.saltproject.io", "www.zerodayinitiative.com"]
tgts = ["packages.broadcom.com", "www.zerodayinitiative.com"]
ret = None
for tgt in tgts:
low = {

View file

@ -55,33 +55,10 @@ def get_salt_test_commands():
@pytest.fixture(scope="module")
def root_url(salt_release):
if os.environ.get("SALT_REPO_TYPE", "release") == "staging":
repo_domain = os.environ.get(
"SALT_REPO_DOMAIN_STAGING", "staging.repo.saltproject.io"
)
else:
repo_domain = os.environ.get("SALT_REPO_DOMAIN_RELEASE", "repo.saltproject.io")
if "rc" in salt_release:
salt_path = "salt_rc/salt"
else:
salt_path = "salt"
salt_repo_user = os.environ.get("SALT_REPO_USER")
if salt_repo_user:
log.info(
"SALT_REPO_USER: %s",
salt_repo_user[0] + "*" * (len(salt_repo_user) - 2) + salt_repo_user[-1],
)
salt_repo_pass = os.environ.get("SALT_REPO_PASS")
if salt_repo_pass:
log.info(
"SALT_REPO_PASS: %s",
salt_repo_pass[0] + "*" * (len(salt_repo_pass) - 2) + salt_repo_pass[-1],
)
if salt_repo_user and salt_repo_pass:
repo_domain = f"{salt_repo_user}:{salt_repo_pass}@{repo_domain}"
_root_url = f"https://{repo_domain}/{salt_path}/py3"
log.info("Repository Root URL: %s", _root_url)
return _root_url
default_url = "https://packages.broadcom.com/artifactory"
repo_domain = os.environ.get("SALT_REPO_DOMAIN_RELEASE", default_url)
log.info("Repository Root URL: %s", repo_domain)
return repo_domain
@pytest.fixture(scope="module")
@ -95,46 +72,15 @@ def get_salt_release():
if salt_release is None:
if pkg_test_type == "download-pkgs":
log.warning(
"Setting salt release to 3006.0rc2 which is probably not what you want."
"Setting salt release to 3006.0 which is probably not what you want."
)
salt_release = "3006.0rc2"
salt_release = "3006.0"
if pkg_test_type == "download-pkgs":
if packaging.version.parse(salt_release) < packaging.version.parse("3006.0rc1"):
if packaging.version.parse(salt_release) < packaging.version.parse("3006.0"):
log.warning("The salt release being tested, %r looks off.", salt_release)
return salt_release
def get_repo_subpath_params():
current_release = packaging.version.parse(get_salt_release())
params = ["minor", current_release.major]
latest_env_var = os.environ.get("LATEST_SALT_RELEASE")
if latest_env_var is not None:
latest_release = packaging.version.parse(latest_env_var)
if current_release >= latest_release:
log.debug(
"Running the tests for the latest release since %s >= %s",
current_release,
latest_release,
)
params.append("latest")
return params
@pytest.fixture(
scope="module",
params=get_repo_subpath_params(),
)
def repo_subpath(request):
return request.param
@pytest.fixture(scope="module")
def gpg_key_name(salt_release):
if packaging.version.parse(salt_release) > packaging.version.parse("3005"):
return "SALT-PROJECT-GPG-PUBKEY-2023.pub"
return "salt-archive-keyring.gpg"
@pytest.fixture(scope="module")
def salt_release():
yield get_salt_release()
@ -153,8 +99,6 @@ def _setup_system(
shell,
root_url,
salt_release,
gpg_key_name,
repo_subpath,
package_type,
tmp_path_factory,
onedir_install_path,
@ -168,7 +112,6 @@ def _setup_system(
root_url=root_url,
salt_release=salt_release,
downloads_path=downloads_path,
repo_subpath=repo_subpath,
package_type=package_type,
onedir_install_path=onedir_install_path,
):
@ -180,7 +123,6 @@ def _setup_system(
root_url=root_url,
salt_release=salt_release,
downloads_path=downloads_path,
repo_subpath=repo_subpath,
package_type=package_type,
onedir_install_path=onedir_install_path,
)
@ -192,8 +134,6 @@ def _setup_system(
root_url=root_url,
salt_release=salt_release,
downloads_path=downloads_path,
gpg_key_name=gpg_key_name,
repo_subpath=repo_subpath,
)
elif grains["os"] == "Fedora":
setup_redhat_family(
@ -203,8 +143,6 @@ def _setup_system(
root_url=root_url,
salt_release=salt_release,
downloads_path=downloads_path,
gpg_key_name=gpg_key_name,
repo_subpath=repo_subpath,
)
elif grains["os"] == "VMware Photon OS":
setup_redhat_family(
@ -214,8 +152,6 @@ def _setup_system(
root_url=root_url,
salt_release=salt_release,
downloads_path=downloads_path,
gpg_key_name=gpg_key_name,
repo_subpath=repo_subpath,
)
elif grains["os_family"] == "RedHat":
setup_redhat_family(
@ -225,20 +161,14 @@ def _setup_system(
root_url=root_url,
salt_release=salt_release,
downloads_path=downloads_path,
gpg_key_name=gpg_key_name,
repo_subpath=repo_subpath,
)
elif grains["os_family"] == "Debian":
setup_debian_family(
shell,
os_name=grains["os"].lower(),
os_version=grains["osrelease"],
os_codename=grains["oscodename"],
root_url=root_url,
salt_release=salt_release,
downloads_path=downloads_path,
gpg_key_name=gpg_key_name,
repo_subpath=repo_subpath,
package_type=package_type,
onedir_install_path=onedir_install_path,
)
@ -256,34 +186,19 @@ def setup_redhat_family(
root_url,
salt_release,
downloads_path,
gpg_key_name,
repo_subpath,
):
arch = os.environ.get("SALT_REPO_ARCH") or "x86_64"
if os_name == "photon":
os_version = f"{os_version}.0"
if repo_subpath == "minor":
repo_url_base = (
f"{root_url}/{os_name}/{os_version}/{arch}/{repo_subpath}/{salt_release}"
)
else:
repo_url_base = f"{root_url}/{os_name}/{os_version}/{arch}/{repo_subpath}"
gpg_file_url = f"{root_url}/{os_name}/{os_version}/{arch}/{gpg_key_name}"
try:
pytest.helpers.download_file(gpg_file_url, downloads_path / gpg_key_name)
except Exception as exc: # pylint: disable=broad-except
pytest.fail(f"Failed to download {gpg_file_url}: {exc}")
ret = shell.run("rpm", "--import", str(downloads_path / gpg_key_name), check=False)
if ret.returncode != 0:
pytest.fail("Failed to import gpg key")
repo_url_base = f"{root_url}/saltproject-rpm"
# Download the salt.repo
# It contains the gpg key url so we don't need to download it here
salt_repo_url = "https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.repo"
repo_file = pytest.helpers.download_file(
f"{repo_url_base}.repo", downloads_path / f"salt-{os_name}.repo"
salt_repo_url, downloads_path / f"salt.repo"
)
commands = [
@ -293,13 +208,13 @@ def setup_redhat_family(
"yum",
"install",
"-y",
"salt-master",
"salt-minion",
"salt-ssh",
"salt-syndic",
"salt-cloud",
"salt-api",
"salt-debuginfo",
f"salt-master-{salt_release}",
f"salt-minion-{salt_release}",
f"salt-ssh-{salt_release}",
f"salt-syndic-{salt_release}",
f"salt-cloud-{salt_release}",
f"salt-api-{salt_release}",
f"salt-debuginfo-{salt_release}",
),
]
@ -311,14 +226,10 @@ def setup_redhat_family(
def setup_debian_family(
shell,
os_name,
os_version,
os_codename,
root_url,
salt_release,
downloads_path,
gpg_key_name,
repo_subpath,
package_type,
onedir_install_path,
):
@ -333,11 +244,9 @@ def setup_debian_family(
elif arch == "x86_64":
arch = "amd64"
if repo_subpath == "minor":
repo_url_base = f"{root_url}/{os_name}/{os_version}/{arch}/{repo_subpath}/{salt_release}"
else:
repo_url_base = f"{root_url}/{os_name}/{os_version}/{arch}/{repo_subpath}"
gpg_file_url = f"{root_url}/{os_name}/{os_version}/{arch}/{gpg_key_name}"
repo_url_base = f"{root_url}/saltproject-deb/"
gpg_file_url = "https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public"
gpg_key_name = "SALT-PROJECT-GPG-PUBKEY-2023.pub"
try:
pytest.helpers.download_file(gpg_file_url, downloads_path / gpg_key_name)
@ -382,11 +291,9 @@ def setup_debian_family(
else:
# We are testing the onedir download
onedir_name = f"salt-{salt_release}-onedir-linux-{arch}.tar.xz"
if repo_subpath == "minor":
repo_url_base = f"{root_url}/onedir/{repo_subpath}/{salt_release}"
else:
repo_url_base = f"{root_url}/onedir/{repo_subpath}"
onedir_url = f"{repo_url_base}/{onedir_name}"
onedir_url = (
f"{root_url}/saltproject-generic/onedir/{salt_release}/{onedir_name}"
)
onedir_location = downloads_path / onedir_name
onedir_extracted = onedir_install_path
@ -403,24 +310,13 @@ def setup_macos(
root_url,
salt_release,
downloads_path,
repo_subpath,
package_type,
onedir_install_path,
):
arch = os.environ.get("SALT_REPO_ARCH") or "x86_64"
if package_type == "package":
if packaging.version.parse(salt_release) > packaging.version.parse("3005"):
mac_pkg = f"salt-{salt_release}-py3-{arch}.pkg"
if repo_subpath == "minor":
mac_pkg_url = (
f"{root_url}/macos/{repo_subpath}/{salt_release}/{mac_pkg}"
)
else:
mac_pkg_url = f"{root_url}/macos/{repo_subpath}/{mac_pkg}"
else:
mac_pkg_url = f"{root_url}/macos/{salt_release}/{mac_pkg}"
mac_pkg = f"salt-{salt_release}-macos-{arch}.pkg"
mac_pkg = f"salt-{salt_release}-py3-{arch}.pkg"
mac_pkg_url = f"{root_url}/saltproject-generic/macos/{salt_release}/{mac_pkg}"
mac_pkg_path = downloads_path / mac_pkg
pytest.helpers.download_file(mac_pkg_url, mac_pkg_path)
@ -437,11 +333,7 @@ def setup_macos(
else:
# We are testing the onedir download
onedir_name = f"salt-{salt_release}-onedir-macos-{arch}.tar.xz"
if repo_subpath == "minor":
repo_url_base = f"{root_url}/onedir/{repo_subpath}/{salt_release}"
else:
repo_url_base = f"{root_url}/onedir/{repo_subpath}"
onedir_url = f"{repo_url_base}/{onedir_name}"
onedir_url = f"{root_url}/onedir/{salt_release}/{onedir_name}"
onedir_location = downloads_path / onedir_name
onedir_extracted = onedir_install_path
@ -459,7 +351,6 @@ def setup_windows(
root_url,
salt_release,
downloads_path,
repo_subpath,
package_type,
onedir_install_path,
timeout=300,
@ -469,26 +360,18 @@ def setup_windows(
if package_type != "onedir":
root_dir = pathlib.Path(os.getenv("ProgramFiles"), "Salt Project", "Salt")
if packaging.version.parse(salt_release) > packaging.version.parse("3005"):
if package_type.lower() == "nsis":
if arch.lower() != "x86":
arch = arch.upper()
win_pkg = f"Salt-Minion-{salt_release}-Py3-{arch}-Setup.exe"
else:
if arch.lower() != "x86":
arch = arch.upper()
win_pkg = f"Salt-Minion-{salt_release}-Py3-{arch}.msi"
if repo_subpath == "minor":
win_pkg_url = (
f"{root_url}/windows/{repo_subpath}/{salt_release}/{win_pkg}"
)
else:
win_pkg_url = f"{root_url}/windows/{repo_subpath}/{win_pkg}"
ssm_bin = root_dir / "ssm.exe"
if package_type.lower() == "nsis":
if arch.lower() != "x86":
arch = arch.upper()
win_pkg = f"Salt-Minion-{salt_release}-Py3-{arch}-Setup.exe"
else:
win_pkg = f"salt-{salt_release}-windows-{arch}.exe"
win_pkg_url = f"{root_url}/windows/{salt_release}/{win_pkg}"
ssm_bin = root_dir / "bin" / "ssm_bin"
if arch.lower() != "x86":
arch = arch.upper()
win_pkg = f"Salt-Minion-{salt_release}-Py3-{arch}.msi"
win_pkg_url = (
f"{root_url}/saltproject-generic/windows/{salt_release}/{win_pkg}"
)
ssm_bin = root_dir / "ssm.exe"
pkg_path = downloads_path / win_pkg
@ -554,11 +437,7 @@ def setup_windows(
else:
# We are testing the onedir download
onedir_name = f"salt-{salt_release}-onedir-windows-{arch}.zip"
if repo_subpath == "minor":
repo_url_base = f"{root_url}/onedir/{repo_subpath}/{salt_release}"
else:
repo_url_base = f"{root_url}/onedir/{repo_subpath}"
onedir_url = f"{repo_url_base}/{onedir_name}"
onedir_url = f"{root_url}/onedir/{salt_release}/{onedir_name}"
onedir_location = downloads_path / onedir_name
onedir_extracted = onedir_install_path

View file

@ -470,7 +470,7 @@ def test_get_http_proxy_url_username_passwd():
"""
Test _get_http_proxy_url when username and passwod set
"""
host = "repo.saltproject.io"
host = "packages.broadcom.com"
port = "888"
user = "user"
passwd = "password"
@ -486,7 +486,7 @@ def test_get_http_proxy_url():
"""
Test basic functionality for _get_http_proxy_url
"""
host = "repo.saltproject.io"
host = "packages.broadcom.com"
port = "888"
user = ""
passwd = ""

View file

@ -622,8 +622,7 @@ class SaltPkgInstall:
def install_previous(self, downgrade=False):
"""
Install previous version. This is used for
upgrade tests.
Install previous version. This is used for upgrade tests.
"""
major_ver = packaging.version.parse(self.prev_version).major
relenv = packaging.version.parse(self.prev_version) >= packaging.version.parse(
@ -632,9 +631,7 @@ class SaltPkgInstall:
distro_name = self.distro_name
if distro_name in ("almalinux", "rocky", "centos", "fedora"):
distro_name = "redhat"
root_url = "salt/py3/"
if self.classic:
root_url = "py3/"
root_url = "https://packages.broadcom.com/artifactory"
if self.distro_name in [
"almalinux",
@ -649,11 +646,6 @@ class SaltPkgInstall:
# Removing EPEL repo files
for fp in pathlib.Path("/etc", "yum.repos.d").glob("epel*"):
fp.unlink()
gpg_key = "SALTSTACK-GPG-KEY.pub"
if self.distro_version == "9":
gpg_key = "SALTSTACK-GPG-KEY2.pub"
if relenv:
gpg_key = "SALT-PROJECT-GPG-PUBKEY-2023.pub"
if platform.is_aarch64():
arch = "arm64"
@ -718,36 +710,36 @@ class SaltPkgInstall:
arch = "arm64"
else:
arch = "amd64"
pathlib.Path("/etc/apt/keyrings").mkdir(parents=True, exist_ok=True)
gpg_dest = "salt-archive-keyring.gpg"
gpg_key = gpg_dest
if relenv:
gpg_key = "SALT-PROJECT-GPG-PUBKEY-2023.gpg"
gpg_full_path = "/etc/apt/keyrings/salt-archive-keyring.gpg"
# download the gpg pub key
download_file(
"https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public",
f"/etc/apt/keyrings/{gpg_dest}",
)
download_file(
"https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.sources",
"/etc/apt/sources.list.d/salt.sources",
f"{root_url}/api/security/keypair/SaltProjectKey/public",
f"{gpg_full_path}",
)
with salt.utils.files.fopen(
pathlib.Path("/etc", "apt", "sources.list.d", "salt.list"), "w"
) as fp:
fp.write(
f"deb [signed-by={gpg_full_path} arch={arch}] "
f"{root_url}/saltproject-deb/ {self.distro_codename} main"
)
self._check_retcode(ret)
cmd = [
self.pkg_mngr,
"install",
*self.salt_pkgs,
"-y",
]
cmd = [self.pkg_mngr, "install", *self.salt_pkgs, "-y"]
if downgrade:
pref_file = pathlib.Path("/etc", "apt", "preferences.d", "salt.pref")
pref_file.parent.mkdir(exist_ok=True)
# TODO: There's probably something I should put in here to say what version
# TODO: But maybe that's done elsewhere, hopefully in self.salt_pkgs
pref_file.write_text(
textwrap.dedent(
"""\
f"""\
Package: salt*
Pin: origin "packages.broadcom.com"
Pin: origin "{root_url}/saltproject-deb"
Pin-Priority: 1001
"""
),
@ -762,7 +754,7 @@ class SaltPkgInstall:
"-o",
"DPkg::Options::=--force-confold",
]
ret = self.proc.run(self.pkg_mngr, "update", *extra_args, env=env)
self.proc.run(self.pkg_mngr, "update", *extra_args, env=env)
cmd.extend(extra_args)
@ -782,37 +774,20 @@ class SaltPkgInstall:
elif platform.is_windows():
self.bin_dir = self.install_dir / "bin"
self.run_root = self.bin_dir / "salt.exe"
self.ssm_bin = self.bin_dir / "ssm.exe"
if self.file_ext == "msi" or relenv:
self.ssm_bin = self.install_dir / "ssm.exe"
self.ssm_bin = self.install_dir / "ssm.exe"
if not self.classic:
if not relenv:
win_pkg = (
f"salt-{self.prev_version}-1-windows-amd64.{self.file_ext}"
)
else:
if self.file_ext == "msi":
win_pkg = (
f"Salt-Minion-{self.prev_version}-Py3-AMD64.{self.file_ext}"
)
elif self.file_ext == "exe":
win_pkg = f"Salt-Minion-{self.prev_version}-Py3-AMD64-Setup.{self.file_ext}"
win_pkg_url = (
f"https://packages.broadcom.com/artifactory/saltproject-generic/"
f"windows/{self.prev_version}/{win_pkg}"
if self.file_ext == "exe":
win_pkg = (
f"Salt-Minion-{self.prev_version}-Py3-AMD64-Setup.{self.file_ext}"
)
elif self.file_ext == "msi":
win_pkg = f"Salt-Minion-{self.prev_version}-Py3-AMD64.{self.file_ext}"
else:
if self.file_ext == "msi":
win_pkg = (
f"Salt-Minion-{self.prev_version}-Py3-AMD64.{self.file_ext}"
)
elif self.file_ext == "exe":
win_pkg = f"Salt-Minion-{self.prev_version}-Py3-AMD64-Setup.{self.file_ext}"
win_pkg_url = (
f"https://packages.broadcom.com/artifactory/saltproject-generic/"
f"windows/{self.prev_version}/{win_pkg}"
)
log.debug(f"Unknown windows file extension: {self.file_ext}")
win_pkg_url = (
f"{root_url}/saltproject-generic/windows/{major_ver}/{win_pkg}"
)
pkg_path = pathlib.Path(r"C:\TEMP", win_pkg)
pkg_path.parent.mkdir(exist_ok=True)
download_file(win_pkg_url, pkg_path)
@ -847,21 +822,8 @@ class SaltPkgInstall:
else:
arch = "x86_64"
if self.classic:
mac_pkg = f"salt-{self.prev_version}-py3-{arch}.pkg"
mac_pkg_url = (
f"https://packages.broadcom.com/artifactory/saltproject-generic/"
f"macos/{self.prev_version}/{mac_pkg}"
)
else:
if not relenv:
mac_pkg = f"salt-{self.prev_version}-1-macos-{arch}.pkg"
else:
mac_pkg = f"salt-{self.prev_version}-py3-{arch}.pkg"
mac_pkg_url = (
f"https://packages.broadcom.com/artifactory/saltproject-generic/"
f"macos/{self.prev_version}/{mac_pkg}"
)
mac_pkg = f"salt-{self.prev_version}-py3-{arch}.pkg"
mac_pkg_url = f"{root_url}/saltproject-generic/macos/{major_ver}/{mac_pkg}"
mac_pkg_path = f"/tmp/{mac_pkg}"
if not os.path.exists(mac_pkg_path):

View file

@ -10,6 +10,7 @@
"""
import hashlib
from html.parser import HTMLParser
import requests
@ -21,7 +22,34 @@ def latest_installer_name(arch="AMD64", **kwargs):
"""
Create an installer file name
"""
return f"Salt-Minion-Latest-Py3-{arch}-Setup.exe"
# This is where windows packages are found
# Each version is in its own directory, so we need to list the directories
# and use the last one as the latest
html_response = requests.get(REPO)
versions = []
# Create a class so we can define how to handle the starttag
# We're looking for a "href" in the "a" tag which is the version
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
# Only parse the 'anchor' tag.
if tag == "a":
# Check the list of defined attributes.
for name, value in attrs:
# If href is defined, add the value to the list of versions
if name == "href":
versions.append(value.strip("/"))
parser = MyHTMLParser()
parser.feed(html_response.text)
parser.close()
latest = versions[-1]
return f"{PREFIX}{latest}-Py3-{arch}-Setup.exe"
def download_and_verify(fp, name, repo=REPO):