Comments (10)
@logicminds do you have any ideas here?
from ra10ke.
The issue comes from:
https://github.com/puppetlabs/forge-ruby/blob/51b76eb7eed48be63ca8f03ba717b8527bee8260/lib/puppet_forge/v3/base.rb#L69
from ra10ke.
I'll take a look when I get a chance.
from ra10ke.
ahhhhhhh software.. so the Puppetfile starts with # used in profiles
ra10ke/lib/ra10ke/deprecation.rb
Lines 43 to 55 in 07fbd73
forge_modules(puppetfile)
seems to return an iterable and the following first hash:
{:namespace=>nil, :name=>nil, :args=>{}}
Since that's total crap, module_name
contains only -
and the forge URI is v3/modules/-
which leads to the HTTP 400 error
from ra10ke.
and I'm quite sure comments are valid in a Puppetfile, so the parser is broken
from ra10ke.
AFAIK, comments are just ignored. So should not be an issue.
https://github.com/voxpupuli/ra10ke/blob/master/lib/ra10ke/puppetfile_parser.rb#L33
from ra10ke.
I'm not sure if that's the correct line. I think
ra10ke/lib/ra10ke/puppetfile_parser.rb
Line 31 in 07fbd73
ra10ke/lib/ra10ke/monkey_patches.rb
Lines 23 to 27 in 07fbd73
(but looks like it doesn't)
from ra10ke.
https://github.com/voxpupuli/ra10ke/pull/new/deprecation-issue
There is a test on this branch for reproduction.
bundle exec rspec spec/ra10ke/deprecation_spec.rb:43
from ra10ke.
mhm doing it by hand works also 🤔
irb(main):004:0> file = File.read('Puppetfile')
=> "# used in profiles\nmod 'puppet/systemd', :latest\nmod 'puppet/lldpd', :latest\nmod 'puppet/ferm', :latest\nmod 'puppet/borg', :latest\nmod 'puppet/wireguard', :latest\nmod 'puppet/bird', :latest\nmod 'he...
irb(main):005:0> file.lines.reject { |line| line.match(/#.*\n/) }.join("\n")
=> "mod 'puppet/systemd', :latest\n\nmod 'puppet/lldpd', :latest\n\nmod 'puppet/ferm', :latest\n\nmod 'puppet/borg', :latest\n\nmod 'puppet/wireguard', :latest\n\nmod 'puppet/bird', :latest\n\nmod 'herculesteam/augeasproviders_pam', :latest\n\nmod 'herculesteam/augeasproviders_shellvar', :latest\n\nmod 'puppetlabs/vcsrepo', :latest\n\nmod 'saz/ssh', :latest\n\nmod 'puppet/r10k', :latest\n\nmod 'puppet/dbbackup', :latest\n\nmod 'puppet/mosquitto', :latest\n\nmod 'puppet/grafana', :latest\n\nmod 'puppet/nginx', :latest\n\nmod 'puppet/ssh_keygen', :latest\n\nmod 'puppet/unbound', :latest\n\nmod 'puppetlabs/inifile', :latest\n\nmod 'puppet/prometheus', :latest\n\nmod 'theforeman/foreman', :latest\n\nmod 'theforeman/puppet', :latest\n\nmod 'theforeman/foreman_proxy', :latest\n\nmod 'puppet/nftables', :latest\n\nmod 'herculesteam/augeasproviders_sysctl', :latest\n\nmod 'camptocamp/catalog_diff', :latest\n\nmod 'puppet/unattended_upgrades', :latest\n\nmod 'puppet/selinux', :latest\n\nmod 'choria/choria', :latest\n\nmod 'puppet/archive', :latest\n\nmod 'puppet/elasticsearch', :latest\n\nmod 'jsok/vault',\n\n git: 'https://github.com/bastelfreak/puppet-vault',\n\n ref: 'test'\n\n\n\nmod 'herculesteam/augeasproviders_core', :latest\n\nmod 'puppetlabs/stdlib', :latest\n\nmod 'choria/mcollective', :latest\n\nmod 'puppetlabs/concat', :latest\n\nmod 'puppetlabs/apt', :latest\n\nmod 'puppetlabs/apache', :latest\n\nmod 'puppetlabs/postgresql', :latest\n\nmod 'puppet/extlib', :latest\n\nmod 'puppet/redis', :latest\n\nmod 'puppet/epel', :latest\n\nmod 'theforeman/puppetserver_foreman', :latest\n\nmod 'richardc/datacat', :latest\n\nmod 'theforeman/dns', :latest\n\nmod 'theforeman/dhcp', :latest\n\nmod 'theforeman/tftp', :latest\n\nmod 'puppetlabs/xinetd', :latest\n\nmod 'choria-mcollective_choria', :latest\n\nmod 'choria/mcollective_agent_puppet', :latest\n\nmod 'choria/mcollective_agent_package', :latest\n\nmod 'choria/mcollective_agent_service', :latest\n\nmod 'choria/mcollective_agent_filemgr', :latest\n\nmod 'choria/mcollective_agent_shell', :latest\n\nmod 'choria/mcollective_agent_nettest', :latest\n\nmod 'choria/mcollective_agent_puppetca', :latest\n\nmod 'choria/mcollective_agent_bolt_tasks', :latest\n\nmod 'choria/mcollective_agent_iptables', :latest\n\nmod 'choria/mcollective_agent_process', :latest\n\nmod 'choria/mcollective_util_actionpolicy', :latest\n\nmod 'optiz0r/mcollective_agent_puppet_env', :latest\n\nmod 'jay7x/mcollective_agent_query', :latest\n\nmod 'choria/mcollective_data_sysctl', :latest\n\nmod 'puppet/yum', :latest\n\nmod 'puppetlabs/java', :latest\n\nmod 'puppet/elastic_stack', :latest\n\nmod 'puppet/hashi_stack', :latest\n\n\n\nmod 'puppetlabs-sshkeys_core', :latest\n\nmod 'puppetlabs-mount_core', :latest\n\nmod 'puppetlabs-augeas_core', :latest\n\nmod 'puppetlabs-selinux_core', :latest\n\nmod 'puppetlabs-yumrepo_core', :latest\n"
irb(main):006:0>
from ra10ke.
Ok, so line 31 causes empty quotes which is not removed in the parser
all_lines = File.read(puppetfile).lines.map(&:strip_comment)
This line leaves empty quotes when it should not.
from ra10ke.
Related Issues (20)
- New release (v0.5.0) HOT 3
- r10k:syntax always exits 0 HOT 2
- check for duplicates
- sort task
- rake validate error HOT 3
- Task r10k:syntax is unknown HOT 3
- Include Changelog entries in r10k:dependencies output HOT 1
- [Feature Request] Speed up forge queries
- [Feature Request] Possibly use the Puppetfile Resolver? HOT 3
- validate task fails when repo does not exist HOT 2
- Issues using with Puppet 7 HOT 1
- incompatible with r10k gem > 3.8 HOT 2
- Support r10k:validate with control_branch
- Add support for commit ref HOT 3
- cache dir does not exist
- [DOC] Example CI job
- [Feature] non-zero exit status when dependencies are out of date HOT 1
- [Feature] cleaner reporting when "No data."
- module with https + token is failing HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ra10ke.