Re: [PATCH 1/3] Add ntp module to facilitate NTP-related code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +def save_servers_to_config(servers, conf_file_path=NTP_CONFIG_FILE,
> +                           srv_regexp=SRV_LINE_REGEXP, out_file_path=None):
> +    """
> +    Replaces the servers defined in the chornyd's configuration file with
> +    the given ones. If the out_file is not None, then it is used for the
> +    resulting config.
> +
> +    @type servers: iterable
> +    @param out_file_path: path to the file used for the resulting config
> +
> +    """

Little typo in the comment above - "chornyd's" -> "chronyd's".

> +
> +    old_conf_file = open(conf_file_path, "r")
> +    if out_file_path:
> +        new_conf_file = open(out_file_path, "w")
> +    else:
> +        (fildes, temp_path) = tempfile.mkstemp()
> +        new_conf_file = os.fdopen(fildes, "w")

You should handle the possibility that the opens could fail.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux