Not sure this function name makes that much sense if it doesn't upload if http_requests is not nil. Maybe a function ```get_upload_facts_request(certname, filename)``` would make more sense? Then you either call ```upload_facts``` or ```upload_facts_parallel``` but both call ```get_upload_facts_request```. There may be some inspiration in https://github.com/oxilion/puppet-foreman/blob/settings-file/files/external_node.rb where I factored out the connection as well.