|
3 | 3 | # Licensed under the MIT License. See License.txt in the project root for license information. |
4 | 4 | # -------------------------------------------------------------------------------------------- |
5 | 5 |
|
6 | | -import json |
7 | 6 | import os |
8 | 7 | import sys |
9 | | -import tempfile |
10 | 8 | from typing import BinaryIO, Optional |
11 | 9 |
|
12 | | -from azext_confcom import config |
13 | 10 | from azext_confcom import oras_proxy, os_util, security_policy |
14 | 11 | from azext_confcom._validators import resolve_stdio |
15 | 12 | from azext_confcom.config import ( |
|
20 | 17 | from azext_confcom.fragment_util import get_all_fragment_contents |
21 | 18 | from azext_confcom.init_checks import run_initial_docker_checks |
22 | 19 | from azext_confcom.kata_proxy import KataPolicyGenProxy |
23 | | -from azext_confcom.security_policy import AciPolicy, OutputType, policy_deserialize |
24 | | -from azext_confcom.lib.policy import Container |
25 | | -from azext_confcom.lib.serialization import policy_serialize, policy_deserialize |
| 20 | +from azext_confcom.security_policy import AciPolicy, OutputType |
26 | 21 | from azext_confcom.command.radius_policy_insert import radius_policy_insert as _radius_policy_insert |
| 22 | +from azext_confcom.command.containers_from_radius import containers_from_radius as _containers_from_radius |
27 | 23 | from azext_confcom.template_util import ( |
28 | 24 | get_image_name, inject_policy_into_template, inject_policy_into_yaml, |
29 | 25 | pretty_print_func, print_existing_policy_from_arm_template, |
30 | 26 | print_existing_policy_from_yaml, print_func, str_to_sha256) |
31 | | -from azext_confcom.command.containers_from_radius import containers_from_radius as _containers_from_radius |
32 | 27 | from knack.log import get_logger |
33 | 28 | from pkg_resources import parse_version |
34 | 29 |
|
@@ -367,12 +362,6 @@ def acifragmentgen_confcom( |
367 | 362 | feed = get_image_name(image_target) |
368 | 363 |
|
369 | 364 | fragment_text = policy.generate_fragment(namespace, svn, output_type, omit_id=omit_id) |
370 | | - with tempfile.NamedTemporaryFile(mode="w+", delete=True) as temp_policy_file: |
371 | | - temp_policy_file.write(fragment_text) |
372 | | - temp_policy_file.flush() |
373 | | - policy_obj = policy_deserialize(temp_policy_file.name) |
374 | | - policy_obj.containers.extend(Container(**json.loads(c)) for c in container_definitions) |
375 | | - fragment_text = policy_serialize(policy_obj) |
376 | 365 |
|
377 | 366 | if output_type != security_policy.OutputType.DEFAULT and not no_print: |
378 | 367 | print(fragment_text) |
|
0 commit comments