<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 10.05.2016 14:42, Gabe Alford wrote:<br>
    </div>
    <blockquote
cite="mid:CAGLxfGwoZqup_en7DjTzSBEDFZ63QhNrTj8ORKYS4tNeRmc7mQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Tue, May 10, 2016 at 6:26 AM,
            Martin Basti <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:mbasti@redhat.com" target="_blank">mbasti@redhat.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"><span class="">
                  <p><br>
                  </p>
                  <br>
                  <div>On 10.05.2016 14:13, Gabe Alford wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div class="gmail_extra">
                        <div class="gmail_quote">On Tue, May 10, 2016 at
                          2:00 AM, Martin Basti <span dir="ltr"><<a
                              moz-do-not-send="true"
                              href="mailto:mbasti@redhat.com"
                              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:mbasti@redhat.com">mbasti@redhat.com</a></a>></span>
                          wrote:<br>
                          <blockquote class="gmail_quote"
                            style="margin:0px 0px 0px
                            0.8ex;border-left:1px solid
                            rgb(204,204,204);padding-left:1ex">
                            <div bgcolor="#FFFFFF" text="#000000"><span>
                                <p><br>
                                </p>
                                <br>
                                <div>On 04.05.2016 15:14, Gabe Alford
                                  wrote:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div class="gmail_extra">
                                      <div class="gmail_quote">On Tue,
                                        May 3, 2016 at 11:17 PM,
                                        Abhijeet Kasurde <span
                                          dir="ltr"><<a
                                            moz-do-not-send="true"
                                            href="mailto:akasurde@redhat.com"
                                            target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:akasurde@redhat.com">akasurde@redhat.com</a></a>></span>
                                        wrote:<br>
                                        <blockquote class="gmail_quote"
                                          style="margin:0px 0px 0px
                                          0.8ex;border-left:1px solid
                                          rgb(204,204,204);padding-left:1ex">
                                          <div bgcolor="#FFFFFF"
                                            text="#000000"> Hi Gabe, <br>
                                            <br>
                                            I am wondering, how are we
                                            handling
                                            "CalledProcessError"
                                            exception ?<br>
                                          </div>
                                        </blockquote>
                                        <div><br>
                                        </div>
                                        <div>I am not sure 100% what you
                                          are asking, but from what I
                                          understand, the
                                          "CalledProcessError" exception
                                          is when a process returns a
                                          non-zero exit status.<br>
                                        </div>
                                        <div>However when running
                                          'ipa-nis-manage enable', an
                                          exception is never hit even if
                                          portmap is not installed,
                                          hence portmap always being
                                          enabled.<br>
                                          <br>
                                        </div>
                                        <div>So it seems that if the
                                          process is not installed,
                                          "CalledProcessError" doesn't
                                          catch an error.<br>
                                          <br>
                                        </div>
                                        <div>Gabe <br>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </blockquote>
                              </span> Hello,<br>
                              <br>
                              portmap.enable() may raise the
                              "CalledProcessError" in case that systemct
                              enable failed and we should catch this
                              exception and handle it in the same way as
                              it is done now. i.e catch that exception
                              and set proper return state.<br>
                              <br>
                              Martin^2<span><br>
                              </span></div>
                          </blockquote>
                          <div><br>
                          </div>
                          <div>Shouldn't "CalledProcessError" raise an
                            exception in this case? In my testing, it
                            doesn't seem to raise an exception when the
                            service does not even exist on the system.<br>
                            <br>
                          </div>
                          <div>Gabe<br>
                          </div>
                          <div><br>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </span> You are right, there is try-except-pass, so no
                exception can be raised<br>
                <br>
                <pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:9.0pt"><span style="color:#000080;font-weight:bold">def </span>__enable(<span style="color:#94558d">self</span>, instance_name=<span style="color:#008000;font-weight:bold">""</span>):
    <span style="color:#000080;font-weight:bold">try</span>:
        ipautil.run([paths.SYSTEMCTL, <span style="color:#008000;font-weight:bold">"enable"</span>,
                     <span style="color:#94558d">self</span>.service_instance(instance_name)])
    <span style="color:#000080;font-weight:bold">except </span>ipautil.CalledProcessError:
        <span style="color:#000080;font-weight:bold">pass</span></pre>
                <span class="HOEnZb"><font color="#888888"> <br>
                    Martin</font></span><span class=""><br>
                </span></div>
            </blockquote>
            <div><br>
            </div>
            <div>It is also the case for disable(), mask(), unmask(),
              etc. Should we update the exception in __enable() or is
              there a reason that it just passes at exception?<br>
              <br>
            </div>
            <div>Gabe<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    I dont think that we should chnge behavior there, what I'm missing
    there is proper logging :) If you want you can create ticket for it.
    Leave try-except-pass there, changing this may affect a lot of
    places, and there is no time to fix it in 4.4 release.<br>
    <br>
    Martin^2<br>
    <blockquote
cite="mid:CAGLxfGwoZqup_en7DjTzSBEDFZ63QhNrTj8ORKYS4tNeRmc7mQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"><span class="">
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div class="gmail_extra">
                        <div class="gmail_quote">
                          <div> </div>
                          <blockquote class="gmail_quote"
                            style="margin:0px 0px 0px
                            0.8ex;border-left:1px solid
                            rgb(204,204,204);padding-left:1ex">
                            <div bgcolor="#FFFFFF" text="#000000"><span>
                                <br>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div class="gmail_extra">
                                      <div class="gmail_quote">
                                        <div> </div>
                                        <blockquote class="gmail_quote"
                                          style="margin:0px 0px 0px
                                          0.8ex;border-left:1px solid
                                          rgb(204,204,204);padding-left:1ex">
                                          <div bgcolor="#FFFFFF"
                                            text="#000000">
                                            <div>
                                              <div>
                                                <div>On 05/04/2016 09:17
                                                  AM, Gabe Alford wrote:<br>
                                                </div>
                                                <blockquote type="cite">
                                                  <div dir="ltr">
                                                    <div>
                                                      <div>Hello,<br>
                                                        <br>
                                                        Fix for <a
                                                          moz-do-not-send="true"
href="https://fedorahosted.org/freeipa/ticket/5857" target="_blank"><a class="moz-txt-link-freetext" href="https://fedorahosted.org/freeipa/ticket/5857">https://fedorahosted.org/freeipa/ticket/5857</a></a><br>
                                                        <br>
                                                      </div>
                                                      Thanks,<br>
                                                      <br>
                                                    </div>
                                                    Gabe<br>
                                                  </div>
                                                  <br>
                                                  <fieldset></fieldset>
                                                  <br>
                                                </blockquote>
                                              </div>
                                            </div>
                                            Thanks,<br>
                                            Abhijeet Kasurde<br>
                                          </div>
                                        </blockquote>
                                      </div>
                                      <br>
                                    </div>
                                  </div>
                                  <br>
                                  <fieldset></fieldset>
                                  <br>
                                </blockquote>
                                <br>
                              </span></div>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                </span></div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>