'Check if root key and certificate files (either default or as
specified on the command line) exist in the path and error out if
they do not. If there are no path errors, create a new node
certificate signed by the root and write it out to the current
directory.'

def run(self):

    if (self['inputpath'] is None):
        self['inputpath'] = os.getcwd()
    if (self['outputpath'] is None):
        self['outputpath'] = os.getcwd()
    self['inputpath'] = FilePath(self['inputpath'])
    self['outputpath'] = FilePath(self['outputpath'])
    try:
        try:
            ca = RootCredential.from_path(self['inputpath'])
            nc = NodeCredential.initialize(self['outputpath'], ca)
            self._sys_module.stdout.write(u'Created    {uuid}.crt.    Copy    it    over    to    /etc/flocker/node.crt    on    your    node    machine    and    make    sure    to    chmod    0600    it.\n'.format(uuid=nc.uuid).encode('utf-8'))
        except PathError as e:
            raise UsageError(str(e))
    except UsageError as e:
        raise SystemExit(u'Error:    {error}'.format(error=str(e)))
    return succeed(None)
