@@ -114,18 +114,18 @@ def get_config_action_name(config, config_type):
114
114
r"[^A-Za-z0-9-_]+" , "_" , suffix
115
115
)
116
116
117
- if cdict [ "restore_config_list" ] and not cdict [ "snapshot_config_list" ] :
117
+ if cdict . get ( "restore_config_list" ) and not cdict . get ( "snapshot_config_list" ) :
118
118
LOG .error (
119
119
"No RestoreConfig found. Please add/associate a RestoreConfig with the SnapshotConfig(s)."
120
120
)
121
121
sys .exit ("Missing snapshot configs" )
122
122
123
- if cdict [ "snapshot_config_list" ] and not cdict [ "restore_config_list" ] :
123
+ if cdict . get ( "snapshot_config_list" ) and not cdict . get ( "restore_config_list" ) :
124
124
LOG .error (
125
125
"No snapshot config found. Cannot use RestoreConfig without a SnapshotConfig."
126
126
)
127
127
sys .exit ("Missing restore configs" )
128
- for config in cdict [ "patch_list" ] :
128
+ for config in cdict . get ( "patch_list" , []) :
129
129
if not isinstance (config , PatchConfigSpecType ):
130
130
LOG .error (
131
131
"{} is not an object of PatchConfig. patch_config is an array of PatchConfig objects" .format (
@@ -135,7 +135,7 @@ def get_config_action_name(config, config_type):
135
135
sys .exit ("{} is not an instance of PatchConfig" .format (config ))
136
136
config = set_config_type_based_on_target (config , "patch" )
137
137
138
- for config in cdict [ "restore_config_list" ] :
138
+ for config in cdict . get ( "restore_config_list" , []) :
139
139
if not isinstance (config , RestoreConfigSpecType ):
140
140
LOG .error (
141
141
"{} is not an object of RestoreConfig. restore_configs is an array of AppProtection.RestoreConfig objects" .format (
@@ -149,7 +149,7 @@ def get_config_action_name(config, config_type):
149
149
if config_action :
150
150
cdict ["action_list" ].append (config_action )
151
151
152
- for config in cdict [ "snapshot_config_list" ] :
152
+ for config in cdict . get ( "snapshot_config_list" , []) :
153
153
if not isinstance (config , SnapshotConfigSpecType ):
154
154
LOG .error (
155
155
"{} is not an object of SnapshotConfig. snapshot_configs is an array of AppProtection.SnapshotConfig objects" .format (
0 commit comments