Displaying 20 results from an estimated 32243 matches for "unless".
2009 Oct 01
9
Strange problem with "and" - "&&"
Hello
I have a strange problem with this code:
<%unless (@students.empty? and params[:commit].nil?) %>
<%="test"%>
<%= render :partial => ''results'' %>
<% end %>
Even though in some cases @students.empty? returns false and params
[:commit].nil? returns true (or the opposite), it displays the test
and...
2010 Feb 18
1
[PATCH] Converter: Remove argument checking from internal functions
...x 87eeeb3..1186430 100644
--- a/lib/Sys/VirtV2V/Converter/Linux.pm
+++ b/lib/Sys/VirtV2V/Converter/Linux.pm
@@ -133,14 +133,6 @@ sub convert
sub _remap_block_devices
{
my ($guestos, $dom, $desc, $virtio) = @_;
- die("remap_block_devices called without guestos argument")
- unless defined($guestos);
- die("remap_block_devices called without dom argument")
- unless defined($dom);
- die("remap_block_devices called without desc argument")
- unless defined($desc);
- die("remap_block_devices called without virtio argument")
-...
2008 Dec 18
3
errors after 0.24.7 upgrade ..
...Rails::Host:0xb72c0c38>
I do not use environment''s and they are not defined anywhere in the
puppet.conf (below).
Also seeing;
Thu Dec 18 15:55:58 +1100 2008
/Settings[/etc/puppet/puppet.conf]/Settings[puppetmasterd]/File[/opt/puppet/bucket]/owner
(warning): Cannot manage ownership unless running as root
Thu Dec 18 15:55:58 +1100 2008
/Settings[/etc/puppet/puppet.conf]/Settings[rails]/File[/var/lib/puppet/state/clientconfigs.sqlite3]/owner
(warning): Cannot manage ownership unless running as root
Thu Dec 18 15:55:58 +1100 2008
/Settings[/etc/puppet/puppet.conf]/Settings[puppetmas...
2009 Jul 15
2
executing some code with subscribe/notify/unless
...notify => Exec["refresh_conf"],
}
exec { "refresh_conf":
command => "exec something",
#subscribe => File["file1"],
timeout => "-1",
#unless => "condition1",
}
So now I have subscribe and unless commented. subscribe because I added
notify on file1, and unless cause if file1 notifies to refresh it
evaluates conditon1 and,as log is fine, the exec is not refreshed.
So, how may I tell refresh_conf to execu...
2008 Nov 01
2
stuck on a validates_presence_of unless issue
i have a person object. Persons don''t need to have addresses, but if
they have any address field value, they must have them all. So I have
something like this:
validates_presence_of :street_address, :city, :state, :postal_code
unless :address_blank?
address_blank? checks whether all of the address fields are blank.
If I run a test like this, it works:
describe "given attributes" do
before(:each) do
@valid_attributes = {
:first_name => "Jonny",
:middle_name => "D"...
2009 Jul 16
2
In the catalog, /Settings[*] is what?
...is not running on this host, does puppetmasterd act like a
puppetd?
notice: Compiled catalog for inst01.corp.631h.metaweb.com in 0.20
seconds
notice: Reparsing /etc/puppet/puppet.conf
warning: /Settings[/etc/puppet/puppet.conf]/Settings[main]/File[/var/
log/puppet]/owner: Cannot manage ownership unless running as root
warning: /Settings[/etc/puppet/puppet.conf]/Settings[main]/File[/var/
lib/puppet/ssl]/owner: Cannot manage ownership unless running as root
warning: /Settings[/etc/puppet/puppet.conf]/Settings[metrics]/File[/
var/lib/puppet/rrd]/owner: Cannot manage ownership unless running as
root...
2007 Feb 06
14
Unless in exec doesn''t seem to be honored on notify.
This was a fun one to track down...
I was trying to use the append_if_no_such_line script from the wiki and it
was working fine EXCEPT when I threw a notify at it.
The notify appears to completely ignore both unless and onlyif within the
exec for some reason.
If I put the same test in the actual command line, it works fine.
Example:
unless => "/bin/grep -Fqe ''$line'' ''$file''" works normally, but not on notify
name => "/bin/grep -Fqe ''$line...
2010 Apr 08
1
[PATCH] Move all interaction with the config file into Sys::VirtV2V::Config
...ig object to operate on the config file at
+I<path>.
+
+=cut
+
+sub new
+{
+ my $class = shift;
+ my ($path) = @_;
+
+ my $self = {};
+ bless($self, $class);
+
+ die(user_message(__x("Config file {path} doesn't exist",
+ path => $path))) unless (-e $path);
+
+ die(user_message(__x("Don't have permissions to read {path}",
+ path => $path))) unless (-r $path);
+
+ eval {
+ $self->{dom} = new XML::DOM::Parser->parsefile($path);
+ };
+
+ die(user_message(__x("Unable to par...
2006 Jan 04
1
[BUG?] image_tag
...oo/bar.jpg
in the following situation:
/ror/foo/public
/var/www/html/foo -> /var/ror/foo/public/
image_tag("/foo/bar.jpg")
this is exactly how compute_public_path is written to work:
def compute_public_path(source, dir, ext)
source = "/#{dir}/#{source}" unless source.first == "/" || source.include?(":")
source = "#{source}.#{ext}" unless source.include?(".")
source = "#{@controller.request.relative_url_root}#{source}" unless %r{^[-a-z]+://} =~ source
source = ActionController::Base.asset_ho...
2006 Jun 30
8
before_filter: nil vs. true vs. false
...s work is that I should return true if
everything is ok and false if not. How does the filter below work
then (from the Rails Recipies book)?
It would return nil if there''s a user in the session. Does nil count
as true?
before_filter :check_authentication
def check_authentication
unless session[:user]
session[:intended_action] = action_name
session[:intended_controller] = controller_name
redirect_to :action => "signin"
end
end
Thanks, Joel
--
http://wagerlabs.com/
2006 Mar 08
4
unless connected? + multiple databases
Hello all.
I am still having fun with multiple databases. In this case it is the
unless connected? statement.
ActiveRecord::Base establishes a connection that is inherited by the
majority of my models. However one Model (Componentlog) that uses a
separate DB is coded as:
unless Componentlog.connected?
establish_connection(
:adapter => "oci",
:databa...
2006 Aug 02
2
mangle ActiveRecord
...all tables.
It would not be DRY to repeat this on all my migrations.
I figured
module ActiveRecord::ConnectionAdapters::SchemaStatements
def create_table(name, options={})
table_definition = TableDefinition.new(self)
table_definition.primary_key(options[:primary_key] || "id") unless
options[:id] == false
table_definition.column(:obj , :bigint ) unless
options[:obj] == false
table_definition.column(:session_id, :bigint ) unless
options[:session] == false
table_definition.column(:created_at, :datetime) unless
options[:timestamp] == false
table_def...
2009 Aug 26
7
storeconfigs + environments issue
...rmation on all test hosts.
When trying to implent the same idea onto our production puppet
server, I get the following errors:
Aug 26 16:35:53 opsynxsr0097 puppetmasterd[27003]: (/Settings[/etc/
puppet/puppet.conf]/Settings[puppetmasterd]/File[/var/lib/puppet/yaml]/
owner) Cannot manage ownership unless running as root
Aug 26 16:35:53 opsynxsr0097 puppetmasterd[27003]: (/Settings[/etc/
puppet/puppet.conf]/Settings[puppetmasterd]/File[/var/lib/puppet/
bucket]/owner) Cannot manage ownership unless running as root
Aug 26 16:35:53 opsynxsr0097 puppetmasterd[27003]: (/Settings[/etc/
puppet/puppet.conf]...
2006 Jun 26
5
using application_helper.rb
I have a simple Yes/No selection list that I am using in a number of
places. Thinking that I could DRY things out a bit, I added it to
application_helper.rb ...
YES_NO = [
[ "Yes", true ],
[ "No", false ]
].freeze
So I figured I would use it there instead of in each model.rb where
needed.
anyway, in webrick screen, I am continually seeing this...
2007 Apr 13
53
v1.0.0 released
http://dovecot.org/releases/dovecot-1.0.0.tar.gz
http://dovecot.org/releases/dovecot-1.0.0.tar.gz.sig
It took almost 5 years, but it's finally ready. I'm not expecting to
release v1.0.1 anytime soon, unless someone's been sitting on a major
bug just waiting for v1.0 to be released. :)
People wanting new features should start testing the upcoming v1.1.
http://dovecot.org/nightly/ contains now snapshots from CVS HEAD. It
already has tons of new features. I've been using it myself for half a
yea...
2007 Apr 13
53
v1.0.0 released
http://dovecot.org/releases/dovecot-1.0.0.tar.gz
http://dovecot.org/releases/dovecot-1.0.0.tar.gz.sig
It took almost 5 years, but it's finally ready. I'm not expecting to
release v1.0.1 anytime soon, unless someone's been sitting on a major
bug just waiting for v1.0 to be released. :)
People wanting new features should start testing the upcoming v1.1.
http://dovecot.org/nightly/ contains now snapshots from CVS HEAD. It
already has tons of new features. I've been using it myself for half a
yea...
2011 Aug 16
0
help using unless in exec for postgres database creation
Hi,
I have the following exec type:
exec{"createdb":
path => "/usr/bin:/usr/sbin:/bin",
command => "sudo -u postgres createdb -U postgres -E UNICODE opennms",
unless => "sudo -u postgres psql -l | grep opennms > /dev/null",
require => Service["postgresql"],
}
Where this basically says, if the database exists don''t run the create database command. However, the unless statement doesn''t behave like it s...
2012 Mar 27
1
Dovecot / IMAP / New Mails are not shown unless you open the folder in Outlook
Hi,
i use dovecot 2.1.3 on a gentoo system.
Before i installed my new imap server box, everything worked. Now with
Dovecot it does not.
Problem: When i receive a new email, it does not appear in my Outlook unless
i have the IMAP Inbox Folder open (highlighted selection).
Sometimes i have new mail in my inbox for over 15 Minutes and i dont realize
it unless i click on the inbox folder.
Before that problem occured on my old system ( i think it was dovecot as
well ) the inbox folder refreshed automatically a...
2010 May 04
2
[PATCH 1/2] Config: NFC: always create and pass round a Config object
...9,6 +69,9 @@ sub new
my $self = {};
bless($self, $class);
+ # No further config required if no config path was specified
+ return $self if (!defined($path));
+
die(user_message(__x("Config file {path} doesn't exist",
path => $path))) unless (-e $path);
@@ -99,6 +102,8 @@ sub get_transfer_iso
my $dom = $self->{dom};
+ return undef unless (defined($dom));
+
# path-root doesn't have to be defined
my ($root) = $dom->findnodes('/virt-v2v/path-root/text()');
$root = $root->getData() if (defi...
2012 Dec 18
1
Arel limit Where if fields are present
...like this:
def self.advsearch(summary_description, specialties, place)
User.joins(:experience,:summary,:information)
.where(Information.arel_table[:business].eq(false))
.where(Experience.arel_table[:description].matches("%#{summary_description}%") unless !summary_description.nil?
.or(Experience.arel_table[:description].matches("%#{summary_description.capitalize}%")) unless !summary_description.nil?
.or(Experience.arel_table[:job_title].matches("%#{summary_description}%")) unless !summary_description.n...