You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/04/01 23:43:56 UTC
[whimsy] branch master updated: address problems found in testing
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 74ed4e5 address problems found in testing
74ed4e5 is described below
commit 74ed4e5a8f417f82da8e9ba78c3b18d650095ec1
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Sat Apr 1 19:43:45 2017 -0400
address problems found in testing
---
www/secmail/tasks.rb | 10 ++++++++++
www/secmail/views/actions/memapp.json.rb | 19 +++++++++++++------
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/www/secmail/tasks.rb b/www/secmail/tasks.rb
index 2c835f9..7234239 100644
--- a/www/secmail/tasks.rb
+++ b/www/secmail/tasks.rb
@@ -48,6 +48,16 @@ class Wunderbar::JsonBuilder
end
end
+ def _transcript *args
+ return unless @task
+ super
+ end
+
+ def _backtrace *args
+ return unless @task
+ super
+ end
+
def svn *args
args << svnauth if %(checkout update commit).include? args.first
_.system! 'svn', *args
diff --git a/www/secmail/views/actions/memapp.json.rb b/www/secmail/views/actions/memapp.json.rb
index b4b4059..184d885 100644
--- a/www/secmail/views/actions/memapp.json.rb
+++ b/www/secmail/views/actions/memapp.json.rb
@@ -123,11 +123,14 @@ task "update cn=member,ou=groups,dc=apache,dc=org in LDAP" do
ldap.bind("uid=#{env.user.untaint},ou=people,dc=apache,dc=org",
env.password.untaint)
- ldap.modify "cn=#{member},ou=groups,dc=apache,dc=org",
+ ldap.modify "cn=member,ou=groups,dc=apache,dc=org",
[LDAP.mod(LDAP::LDAP_MOD_ADD, 'memberUid', [@availid])]
- _pre "add member: #{ldap.err2string(ldap.err)} (#{ldap.err})",
- class: (ldap.err == 0 ? '_stdout' : '_stderr')
+ if ldap.err == 0
+ _transcript ["LDAP mod add: #{ldap.err2string(ldap.err)} (#{ldap.err})"]
+ else
+ _backtrace ["LDAP mod add: #{ldap.err2string(ldap.err)} (#{ldap.err})"]
+ end
ldap.unbind
end
@@ -202,13 +205,17 @@ task "svn commit memapp-received.text" do
"https://svn.apache.org/repos/private/foundation/Meetings/#{meeting}",
"#{dir}/#{meeting}"
+ # retrieve memapp-received.txt
+ dest = "#{dir}/#{meeting}/memapp-received.txt"
+ svn 'update', dest
+
# create/add file(s)
- received = File.read("#{dir}/#{meeting}/memapp-received.txt")
+ received = File.read(dest)
received[/.*\s#{@availid}\s.*/] = @line
- File.write("#{dir}/#{meeting}/memapp-received.txt", received)
+ File.write(dest, received)
# Show changes
- svn 'diff', ""#{dir}/#{meeting}"
+ svn 'diff', "#{dir}/#{meeting}"
# commit changes
svn 'commit', "#{dir}/#{meeting}/memapp-received.txt", '-m', @document
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].