Compare commits

...

No commits in common. 'c9-beta' and 'i10cs' have entirely different histories.

@ -0,0 +1,40 @@
diff --git a/tests/functional/eks/test_kubeconfig.py b/tests/functional/eks/test_kubeconfig.py
index 3d1bcf8..687eef2 100644
--- a/tests/functional/eks/test_kubeconfig.py
+++ b/tests/functional/eks/test_kubeconfig.py
@@ -121,8 +121,9 @@ class TestKubeconfigLoader(unittest.TestCase):
])
loaded_config = self._loader.load_kubeconfig(simple_path)
self.assertEqual(loaded_config.content, content)
- self._validator.validate_config.called_with(Kubeconfig(simple_path,
- content))
+ validated_config = self._validator.validate_config.call_args.args[0]
+ self.assertEqual(validated_config.path, simple_path)
+ self.assertEqual(validated_config.content, content)
def test_load_noexist(self):
no_exist_path = os.path.join(self._temp_directory,
@@ -130,17 +131,18 @@ class TestKubeconfigLoader(unittest.TestCase):
loaded_config = self._loader.load_kubeconfig(no_exist_path)
self.assertEqual(loaded_config.content,
_get_new_kubeconfig_content())
- self._validator.validate_config.called_with(
- Kubeconfig(no_exist_path, _get_new_kubeconfig_content()))
+ validated_config = self._validator.validate_config.call_args.args[0]
+ self.assertEqual(validated_config.path, no_exist_path)
+ self.assertEqual(validated_config.content, _get_new_kubeconfig_content())
def test_load_empty(self):
empty_path = self._clone_config("valid_empty_existing")
loaded_config = self._loader.load_kubeconfig(empty_path)
self.assertEqual(loaded_config.content,
_get_new_kubeconfig_content())
- self._validator.validate_config.called_with(
- Kubeconfig(empty_path,
- _get_new_kubeconfig_content()))
+ validated_config = self._validator.validate_config.call_args.args[0]
+ self.assertEqual(validated_config.path, empty_path)
+ self.assertEqual(validated_config.content, _get_new_kubeconfig_content())
def test_load_directory(self):
current_directory = self._temp_directory

File diff suppressed because it is too large Load Diff

@ -0,0 +1,95 @@
diff --git a/awscli/customizations/cloudformation/yamlhelper.py b/awscli/customizations/cloudformation/yamlhelper.py
index abdc749..9cf9496 100644
--- a/awscli/customizations/cloudformation/yamlhelper.py
+++ b/awscli/customizations/cloudformation/yamlhelper.py
@@ -92,8 +92,14 @@ def yaml_dump(dict_to_dump):
yaml.Representer = FlattenAliasRepresenter
_add_yaml_1_1_boolean_resolvers(yaml.Resolver)
yaml.Representer.add_representer(OrderedDict, _dict_representer)
+ yaml.Representer.add_representer(dict, _dict_representer)
- return dump_yaml_to_str(yaml, dict_to_dump)
+ result = dump_yaml_to_str(yaml, dict_to_dump)
+
+ # let other YAML instances use the default dict representer
+ yaml.Representer.add_representer(dict, ruamel.yaml.representer.SafeRepresenter.represent_dict)
+
+ return result
def _dict_constructor(loader, node):
diff --git a/awscli/customizations/eks/kubeconfig.py b/awscli/customizations/eks/kubeconfig.py
index 5130f7f..64526a7 100644
--- a/awscli/customizations/eks/kubeconfig.py
+++ b/awscli/customizations/eks/kubeconfig.py
@@ -44,7 +44,7 @@ def _get_new_kubeconfig_content():
("contexts", []),
("current-context", ""),
("kind", "Config"),
- ("preferences", OrderedDict()),
+ ("preferences", {}),
("users", [])
])
@@ -121,7 +121,7 @@ class KubeconfigValidator(object):
if (key in config.content and
type(config.content[key]) == list):
for element in config.content[key]:
- if not isinstance(element, OrderedDict):
+ if not isinstance(element, dict):
raise KubeconfigCorruptedError(
f"Entry in {key} not a {dict}. ")
diff --git a/awscli/customizations/eks/ordered_yaml.py b/awscli/customizations/eks/ordered_yaml.py
index 23834e0..5c0f92a 100644
--- a/awscli/customizations/eks/ordered_yaml.py
+++ b/awscli/customizations/eks/ordered_yaml.py
@@ -46,10 +46,18 @@ def ordered_yaml_dump(to_dump, stream=None):
:type stream: file
"""
yaml = ruamel.yaml.YAML(typ="safe", pure=True)
+ yaml.width = 99999
yaml.default_flow_style = False
yaml.Representer.add_representer(OrderedDict, _ordered_representer)
+ yaml.Representer.add_representer(dict, _ordered_representer)
if stream is None:
- return dump_yaml_to_str(yaml, to_dump)
+ result = dump_yaml_to_str(yaml, to_dump)
+ else:
+ result = None
+ yaml.dump(to_dump, stream)
- yaml.dump(to_dump, stream)
+ # let other YAML instances use the default dict representer
+ yaml.Representer.add_representer(dict, ruamel.yaml.representer.SafeRepresenter.represent_dict)
+
+ return result
diff --git a/tests/unit/customizations/cloudformation/test_yamlhelper.py b/tests/unit/customizations/cloudformation/test_yamlhelper.py
index 466ae2e..1adad4e 100644
--- a/tests/unit/customizations/cloudformation/test_yamlhelper.py
+++ b/tests/unit/customizations/cloudformation/test_yamlhelper.py
@@ -139,10 +139,10 @@ class TestYaml(BaseYAMLTest):
' Name: name1\n'
)
output_dict = yaml_parse(input_template)
- expected_dict = OrderedDict([
- ('B_Resource', OrderedDict([('Key2', {'Name': 'name2'}), ('Key1', {'Name': 'name1'})])),
- ('A_Resource', OrderedDict([('Key2', {'Name': 'name2'}), ('Key1', {'Name': 'name1'})]))
- ])
+ expected_dict = {
+ 'B_Resource': {'Key2': {'Name': 'name2'}, 'Key1': {'Name': 'name1'}},
+ 'A_Resource': {'Key2': {'Name': 'name2'}, 'Key1': {'Name': 'name1'}}
+ }
self.assertEqual(expected_dict, output_dict)
output_template = yaml_dump(output_dict)
@@ -156,7 +156,7 @@ class TestYaml(BaseYAMLTest):
<<: *base
"""
output = yaml_parse(test_yaml)
- self.assertTrue(isinstance(output, OrderedDict))
+ self.assertTrue(isinstance(output, dict))
self.assertEqual(output.get('test').get('property'), 'value')
def test_unroll_yaml_anchors(self):

@ -1,10 +1,18 @@
%bcond tests 1
## START: Set by rpmautospec
## (rpmautospec version 0.6.1)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 2;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
%global pkgname aws-cli
Name: awscli2
Version: 2.15.31
Release: 3%{?dist}
Release: %autorelease
Summary: Universal Command Line Environment for AWS, version 2
# all files are licensed under Apache-2.0, except:
@ -12,17 +20,22 @@ Summary: Universal Command Line Environment for AWS, version 2
# - awscli/botocore/vendored/six.py is MIT
License: Apache-2.0 AND MIT
URL: https://github.com/aws/aws-cli/tree/v2
Source0: https://github.com/aws/aws-cli/archive/%{version}/%{pkgname}-%{version}.tar.gz
# adapt to whitespace formatting changes and removal of OrderedDict in ruamel-yaml
Patch0: ruamel-yaml-0.17.32.patch
# fix Python 3.12 incompatibilities
Patch1: python312.patch
# fix incorrect assertions in TestKubeconfigLoader
Patch2: assertions.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python-unversioned-command
BuildRequires: procps-ng
# Needed for paging output from awscli2. See RHEL-14523.
Requires: less
Recommends: groff
Provides: bundled(python3dist(botocore)) = 2.0.0
@ -60,8 +73,8 @@ find -type f -name '*.py' -exec sed \
-e 's/^\( *\)from mock import/\1from unittest.mock import/' \
-i '{}' +
# RHEL does not run coverage tests.
# mock is deprecated in RHEL. We use unittest.mock.
# Fedora does not run coverage tests.
# mock is deprecated in Fedora. We use unittest.mock.
# pip-tools is not used directly by the unit tests.
# pytest-xdist is unwanted in RHEL.
sed \
@ -91,9 +104,9 @@ rm -vf %{buildroot}%{_bindir}/{aws_bash_completer,aws_zsh_completer.sh,aws.cmd}
# install shell completion
install -Dpm0644 bin/aws_bash_completer \
%{buildroot}%{_datadir}/bash-completion/completions/aws
%{buildroot}%{bash_completions_dir}/aws
install -Dpm0644 bin/aws_zsh_completer.sh \
%{buildroot}%{_datadir}/zsh/site-functions/_awscli
%{buildroot}%{zsh_completions_dir}/_awscli
%check
@ -106,11 +119,7 @@ export TESTS_REMOVE_REPO_ROOT_FROM_PATH=1 TZ=UTC
%if 0%{?rhel}
export OPENSSL_ENABLE_SHA1_SIGNATURES=yes
%endif
%pytest --verbose %{!?rhel:--numprocesses=auto --dist=loadfile --maxprocesses=4} \
--disable-pytest-warnings -Wd \
tests/unit tests/functional \
--ignore tests/functional/autocomplete/test_completion_files.py \
--ignore tests/functional/botocore/test_waiter_config.py
%pytest --verbose %{!?rhel:--numprocesses=auto --dist=loadfile --maxprocesses=4} tests/unit tests/functional
%files -f %{pyproject_files}
@ -118,17 +127,147 @@ export OPENSSL_ENABLE_SHA1_SIGNATURES=yes
%doc README.rst
%{_bindir}/aws
%{_bindir}/aws_completer
%{_datadir}/bash-completion/completions/aws
%{_datadir}/zsh/site-functions/_awscli
%{bash_completions_dir}/aws
%{zsh_completions_dir}/_awscli
%changelog
* Fri May 31 2024 Major Hayden <major@redhat.com> - 2.15.31-3
- Add less to install requirements for paging output. Resolves RHEL-14523.
* Fri Nov 29 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 2.15.31-2
- Rebuilt for MSVSphere 10
## START: Generated by rpmautospec
* Wed Jun 12 2024 Major Hayden <major@redhat.com> - 2.15.31-2
- Add gating.yaml
* Mon Jun 10 2024 Major Hayden <major@redhat.com> - 2.15.31-1
- Update to 2.15.31
* Tue Jan 23 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.15.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.15.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jan 17 2024 Packit <hello@packit.dev> - 2.15.10-1
- [packit] 2.15.10 upstream release
- Resolves rhbz#2255621
* Sat Dec 16 2023 Packit <hello@packit.dev> - 2.15.2-1
- [packit] 2.15.2 upstream release
- Resolves rhbz#2254838
* Fri Dec 15 2023 Packit <hello@packit.dev> - 2.15.1-1
- [packit] 2.15.1 upstream release
- Resolves rhbz#2251124
* Thu Dec 07 2023 Nikola Forró <nforro@redhat.com> - 2.13.37-2
- Fix Python 3.12 patch
* Sat Nov 18 2023 Packit <hello@packit.dev> - 2.13.37-1
- [packit] 2.13.37 upstream release
- Resolves rhbz#2250398
* Wed Nov 15 2023 Packit <hello@packit.dev> - 2.13.36-1
- [packit] 2.13.36 upstream release
- Resolves rhbz#2247595
* Fri Oct 27 2023 Packit <hello@packit.dev> - 2.13.30-1
- [packit] 2.13.30 upstream release
- Resolves rhbz#2203325 Upstream tag: 2.13.30 Upstream commit: 580ceb06
* Tue Oct 24 2023 Packit <hello@packit.dev> - 2.13.28-1
- [packit] 2.13.28 upstream release
* Tue Oct 24 2023 Nikola Forró <nforro@redhat.com> - 2.13.26-4
- Fix ruamel-yaml patch and improve Python version compatibility
* Wed Oct 18 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 2.13.26-3
- Skip flaky yaml output test
* Mon Oct 16 2023 Miro Hrončok <miro@hroncok.cz> - 2.13.26-2
- Don't use pytest-xdist in ELN
* Sat Oct 14 2023 Packit <hello@packit.dev> - 2.13.26-1
- [packit] 2.13.26 upstream release
* Wed Oct 04 2023 Packit <hello@packit.dev> - 2.13.23-1
- [packit] 2.13.23 upstream release
* Sat Sep 09 2023 Packit <hello@packit.dev> - 2.13.17-1
- [packit] 2.13.17 upstream release
* Thu Aug 24 2023 Packit <hello@packit.dev> - 2.13.12-1
- [packit] 2.13.12 upstream release
* Tue Aug 22 2023 Packit <hello@packit.dev> - 2.13.11-1
- [packit] 2.13.11 upstream release
* Thu Aug 17 2023 Nikola Forró <nforro@redhat.com> - 2.13.9-3
- Fix Packit config
* Mon Aug 14 2023 Nikola Forró <nforro@redhat.com> - 2.13.9-2
- Make pull-from-upstream react only to v2 tags
* Fri Aug 11 2023 Packit <hello@packit.dev> - 2.13.9-1
- [packit] 2.13.9 upstream release
* Sat Aug 05 2023 Packit <hello@packit.dev> - 2.13.7-1
- [packit] 2.13.7 upstream release
* Fri Aug 04 2023 Packit <hello@packit.dev> - 2.13.6-1
- [packit] 2.13.6 upstream release
* Fri Jul 28 2023 Davide Cavalca <dcavalca@fedoraproject.org> - 2.13.4-2
- Fix build on ELN
* Thu Jul 27 2023 Packit <hello@packit.dev> - 2.13.4-1
- [packit] 2.13.4 upstream release
* Wed Jul 26 2023 Nikola Forró <nforro@redhat.com> - 2.13.3-1
- Update to 2.13.3 and fix FTBFS
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.12.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 2.12.0-2
- Rebuilt for Python 3.12
* Thu Jun 15 2023 Packit <hello@packit.dev> - 2.12.0-1
- [packit] 2.12.0 upstream release
* Fri Jun 09 2023 Packit <hello@packit.dev> - 2.11.27-1
- [packit] 2.11.27 upstream release
* Thu Jun 08 2023 Packit <hello@packit.dev> - 2.11.26-1
- [packit] 2.11.26 upstream release
* Mon Jun 05 2023 Packit <hello@packit.dev> - 2.11.25-1
- [packit] 2.11.25 upstream release
* Thu Jun 01 2023 Packit <hello@packit.dev> - 2.11.24-1
- [packit] 2.11.24 upstream release
* Sat May 27 2023 Packit <hello@packit.dev> - 2.11.23-1
- [packit] 2.11.23 upstream release
* Fri May 26 2023 Packit <hello@packit.dev> - 2.11.22-1
- [packit] 2.11.22 upstream release
* Sat May 20 2023 Packit <hello@packit.dev> - 2.11.21-1
- [packit] 2.11.21 upstream release
* Sat May 13 2023 Packit <hello@packit.dev> - 2.11.20-1
- [packit] 2.11.20 upstream release
* Thu May 11 2023 Packit <hello@packit.dev> - 2.11.19-1
- [packit] 2.11.19 upstream release
* Wed May 10 2023 Nikola Forró <nforro@redhat.com> - 2.11.18-1
- Update to 2.11.18 and add missing Provides
* Thu May 09 2024 Major Hayden <major@redhat.com> - 2.15.31-2
- Remove colorama patches
- Bring in the latest updates from Fedora
* Mon May 08 2023 Maxwell G <maxwell@gtmx.me> - 2.11.17-4
- fix typo in comment
* Wed Jan 31 2024 Major Hayden <major@redhat.com> - 2.15.31-1
- Initial RHEL 9 package.
* Fri May 05 2023 Nikola Forró <nforro@redhat.com> - 2.11.17-1
- Initial package
## END: Generated by rpmautospec

Loading…
Cancel
Save