1. When you see a function longer than 80 symbols - it's a sign that you need to split it. In this case:

        kill_process = subprocess.Popen(["sudo", "-S", 'kill', '-HUP',
                                        '{}'.format(self.dnsmasq_pid)],
                                        stdin=subprocess.PIPE,
                                        stdout=subprocess.PIPE)
        kill_process.communicate(self.FLAGS.sudopassword+os.linesep)
2. You've decided to store the password in the flags... No luck with /etc/sudoers?