1.0.0 Rework #25
1 changed files with 12 additions and 20 deletions
32
src/main.rs
32
src/main.rs
|
@ -276,27 +276,19 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(cf_entry) = cf_entry {
|
if let Some(cf_entry) = cf_entry {
|
||||||
match cf_zone.update(entry, r#type, &cf_entry.id, ipv6, ipv4) {
|
if cf_zone.update(entry, r#type, &cf_entry.id, ipv6, ipv4).is_ok() {
|
||||||
Ok(_) => {
|
let info_msg = format!("Updated {} DNS Record for entry '{}' in zone '{}'", r#type, entry.name, zone.name);
|
||||||
let info_msg = format!("Updated {} DNS Record for entry '{}' in zone '{}'", r#type, entry.name, zone.name);
|
match connected_to_journal() {
|
||||||
match connected_to_journal() {
|
true => warn!("[INFO] {info_msg}"),
|
||||||
true => warn!("[INFO] {info_msg}"),
|
false => println!("[INFO] {info_msg}"),
|
||||||
false => println!("[INFO] {info_msg}"),
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
Err(_) => {},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
else {
|
else if cf_zone.create(entry, r#type, ipv6, ipv4).is_ok() {
|
||||||
match cf_zone.create(entry, r#type, ipv6, ipv4) {
|
let info_msg = format!("Created {} DNS Record for entry '{}' in zone '{}'", r#type, entry.name, zone.name);
|
||||||
Ok(_) => {
|
match connected_to_journal() {
|
||||||
let info_msg = format!("Created {} DNS Record for entry '{}' in zone '{}'", r#type, entry.name, zone.name);
|
true => info!("[INFO] {info_msg}"),
|
||||||
match connected_to_journal() {
|
false => println!("[INFO] {info_msg}"),
|
||||||
true => info!("[INFO] {info_msg}"),
|
|
||||||
false => println!("[INFO] {info_msg}"),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Err(_) => {},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue