Comments (6)
Looks like a rather severe design error.
Yes, the alternative's name
cannot map to name
and be namevar, because by its nature, you need more than one alternative that share the same name
. However, it's plain that there can also be several independent alternatives with different names (alternatives for different things) that point to the same binary. So the path
(in alternative terms) is not unique at all.
What is probably unique is the name+path
combination, forming a distinct alternative for name
. Going for a composite namevar, however, would likely be absolute overkill.
Proposal: Make the name
parameter meaningless. Add a path
property that takes the role of the current name
parameter. The wrinkle being that it will allow managing the same resource twice or more, like:
alternative_entry { 'nvim as vim':
path => '/usr/bin/nvim',
altlink => '/usr/bin/vim',
altname => 'vim',
}
alternative_entry { 'trololol':
path => '/usr/bin/nvim',
altlink => '/usr/bin/vim',
altname => 'vim',
priority => 9000,
}
Still, I rather feel that this inconvenience is not worth the hassle of dealing with composite namevars. Unless, of course, @crayfishx wishes to step up and do the fun part ;-)
(Note, I especially love how the provider has a name= method despite name
not being a property.)
from puppet-alternatives.
@ffrank I don't think composite namevars are overkill at all, in fact, I think it's very appropriate for this type. I'll try and contribute the 'fun part' ;-)...
from puppet-alternatives.
I would much rather see composite namevars than the leave it open to duplicate resource declarations like in your example.
from puppet-alternatives.
Cool. And yes, that will probably be the only way to build a really clean abstraction.
from puppet-alternatives.
can't we just fix this by using title and name distinctly?
or… use better… names?
from puppet-alternatives.
Well, you can always make name
to be meaningless, so that resource titles become arbitrary.
However (and this is a big one), this allows users to manage any entity with multiple resources (that have different, meaningless names/titles). So that would be quite horrible as well. Let's not do that.
from puppet-alternatives.
Related Issues (20)
- SLES 12 and 15 do not work with puppet-alternatives HOT 2
- Support slave links HOT 1
- No new version on Puppet Forge since 2019 HOT 2
- Could not determine mode after upgrade to 4.1.0
- Error: Could not autoload puppet/provider/alternatives/chkconfig HOT 1
- Could not evaluate: undefined method `[]' for nil:NilClass HOT 7
- Add support for Puppet 8 HOT 1
- Warnings when using Module HOT 1
- Missing provider for AWS Linux
- manual install HOT 2
- How does one set alternative entry back to 'auto' mode? HOT 2
- Release to forge HOT 3
- plugin sync error? HOT 3
- alternative_entry keying to the wrong parameter?
- Debian 6 with Ruby 1.8.7 broken HOT 3
- missing alternatives is not added - it breaks instead HOT 3
- Using a full path for path is not always desirable. HOT 6
- check debian support
- Could not determine auto or manual mode
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 puppet-alternatives.