Comments (6)
What version of the cookbook are you using?
Integration tests show this is working correctly
File "/etc/fstab"
should be file
content
should match /^gluster2:\/gv0 \/mnt\/gv0 glusterfs defaults,_netdev,backupvolfile-server=gluster1 0 0$/
from chef-gluster.
I am using 5.0.2 as well.
I am not sure why the current code passed testing but it should not have worked because of how the "===" method is evaluated for class. Please search for "ruby class in case statement" in your favourite search engine for detail.
from chef-gluster.
What are you putting in for backup_server
? and what does /etc/fstab
show?
from chef-gluster.
I have tried both
backup_server "backup1"
backup_server ["backup1", "backup2"]
With either case, I always ended with just the default mount_option: "defaults,_netdev". So to debug this behaviour I added a fallback else statement to mount.rb
def mount_options_for_backup_server
case new_resource.backup_server.class
when String
',backupvolfile-server=' + new_resource.backup_server
when Array
',backupvolfile-server=' + new_resource.backup_server.join(',backupvolfile-server=')
else
Chef::Log.info "backup_server has unknown class? [" + new_resource.backup_server.class.name + "]"
end
The case statement always fell through, even thought the class is shown correctly as "String" or "Array" in the log output. After further research I found that the object itself should be in the case statement, not object.class, eg
def mount_options_for_backup_server
case new_resource.backup_server
when String
It works for me once I made this change.
from chef-gluster.
Hmm i see what you mean with respect to classes in case statements on http://blog.honeybadger.io/rubys-case-statement-advanced-techniques/
However, if thats true, then integration tests should be failing
from chef-gluster.
Solved by #72
from chef-gluster.
Related Issues (20)
- chef lvm cookbook now use chef-ruby-lvm library instead of di-ruby-lvm HOT 2
- Unable to create a replicated gluster volume on non-root FS HOT 1
- Current version of chef-gluster need peers specified by hostname HOT 1
- Fork this repo HOT 2
- add ChefSpec matcheters HOT 1
- GPT disklabel and partition alignment HOT 6
- Replacing a peer causes server_extend.rb to bomb HOT 12
- client.rb with centos 6.6 and glusterfs 3.7.4 HOT 2
- Peer brick listing always uses fqdn of peers HOT 1
- Doesn't Create Volumes HOT 10
- Using a size attribute with percentage value bombs volume_extend HOT 1
- After successful initial run, subsequent runs blow up at server_extend HOT 16
- bricks_waiting_to_join - undefined method `empty?' for nil:NilClass HOT 17
- requier 'lvm' error HOT 6
- 'peers' attribute it's case sensitive, it should be not? HOT 2
- Allow create gluster without manage lvm volumes HOT 5
- Provisioning multiple disks HOT 3
- Support to install specific patch version HOT 3
- backupvolfile-server invalids option
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 chef-gluster.