首页 > 代码库 > haproxy配置增删改查
haproxy配置增删改查
json (): quit_flag = quit_flag: item_list() choice = ().strip() choice == : backend_info = ().strip() result = fetch(backend_info) (result) choice == : back_up() backend_record_dict = input_json() key backend_record_dict: backend = key record = backend_record_dict[key] delete(backendrecord) choice == : back_up() backend_record_dict = input_json() key backend_record_dict: backend = key record = backend_record_dict[key] add(backendrecord) choice == : back_up() backend_record_dict = input_json() key backend_record_dict: backend = key record = backend_record_dict[key] modify(backendrecord) choice == choice == : quit_flag = () : () (): lis = [] (lis) (): .copyfile() (): flag = fetch_list = [] (=) f: line f: line.strip() == %(): flag = line.strip().startswith(): flag = flag line.strip(): fetch_list.append(line.strip()) fetch_list (): flag = fetch_list = [] (=) f: line f: line.strip() == %(): fetch_list.append() flag = line.strip().startswith(): flag = flag line.strip(): fetch_list.append(line.strip()) fetch_list (): (=) old(=) new: flag = line old: line.strip().startswith() line.strip() == % : flag = new.write(line) new_line : new.write(* + new_line + ) flag line.strip().startswith(): flag = new.write(line) line.strip() flag: new.write(line) (): (=) old(=) new: flag = line old: line.strip().startswith() line.strip() == % : flag = new_line : new.write(* + new_line + ) new.flush() flag line.strip().startswith(): flag = new.write(line) new.flush() line.strip() flag: new.write(line) new.flush() (): (=) old(=) new: flag = line old: line.strip().startswith() line.strip() == % : flag = flag line.strip().startswith(): flag = new.write(line) new.flush() line.strip() flag: new.write(line) new.flush() (): change_flag record_list = fetch() record_list: (=) old(=) new: line old: new.write(line) new.write(+ + ) new.write(* + + ) () change_flag = : record_list: () change_flag = : record_list.append() writer(record_list) () change_flag = change_flag : .move() (): change_flag record_list = fetch1() (record_list) record_list: (.center()) change_flag = : record_list: record_list.remove() writer1(record_list) () change_flag = : writer2() () change_flag = change_flag : .move() change_flag (): change_flag record_list = fetch1() record_list: (=) old(=) new: line old: new.write(line) new.write(+ + ) new.write(* + + ) change_flag = change_flag : .move() : delete() add() change_flag (): continue_flag = continue_flag : backend_record = ().strip() : backend_record_dict = json.loads(backend_record) : () continue_flag = backend_record_dict __name__ == : main()
haproxy配置增删改查
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。