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

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

 



On Tue, 2012-05-29 at 11:50 -0400, Chris Lumens wrote:
> > +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
Good catches both, thanks. I will fix this before pushing.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic

_______________________________________________
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