Re: [PATCH] plugins: ifupdown: support source-directory stanza



On Tue, 2016-09-06 at 09:41 -0400, Tony Espy wrote:
From: Scott Sweeny <scott sweeny canonical com>

Enable the ifupdown settings plugin to read interface
definitions from the source directory:

/etc/network/interfaces.d/
---


Hi Tony,


could you fixup the coding style?




- no { } for single lines:

+              } else {
                    _recursive_ifparser (we.we_wordv[i], quiet);
+              }

+                        while ((item = g_dir_read_name (source_dir))) {
+                             _ifparser_source (item, we.we_wordv[i], quiet, FALSE);
+                        }






- { } for multiple lines:

+                             if (!quiet)
+                                  nm_log_warn (LOGD_SETTINGS, "Failed to open directory %s: %s",
+                                                  we.we_wordv[i], error->message);

                    if (!quiet)
+                        nm_log_warn (LOGD_SETTINGS, "Invalid %s line without parameters\n",
+                                        token[0]);




- a space between function name and (:

  
+                        source_dir = g_dir_open(we.we_wordv[i], 0, &error);


+         else if (strcmp(token[0], "source") == 0 || strcmp(token[0], "source-directory") == 0) {


+                   if (strcmp(token[0], "source-directory") == 0)




- indention:

»···»···»···if (dir) {
»···»···»···»···»···source_dir = g_dir_open(we.we_wordv[i], 0, &error);
»···»···»···»···»···if (!source_dir) {

»···»···»···»···»···} else {
»···»···»···»···»···while ((item = g_dir_read_name (source_dir))) {
»···»···»···»···»···»···_ifparser_source (item, we.we_wordv[i], quiet, FALSE);
»···»···»···»···»···}



- indention with spaces in case of line-breaks:

»···»···»···»···»···»···»···nm_log_warn (LOGD_SETTINGS, "Failed to open directory %s: %s",
»···»···»···»···»···»···»···»···»···»··· we.we_wordv[i], error->message);

»···»···»···»···»···nm_log_warn (LOGD_SETTINGS, "Invalid %s line without parameters\n",
»···»···»···»···»···»···»···»··· token[0]);




Thanks,
Thomas

Attachment: signature.asc
Description: This is a digitally signed message part



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