Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.2:Test
yast2-drbd
update-agent-latest.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File update-agent-latest.diff of Package yast2-drbd
Index: yast2-drbd-2.13.1/agents/drbd.rb.yy =================================================================== --- yast2-drbd-2.13.1.orig/agents/drbd.rb.yy 2008-12-19 17:28:40.000000000 +0800 +++ yast2-drbd-2.13.1/agents/drbd.rb.yy 2008-12-19 17:49:25.000000000 +0800 @@ -1,20 +1,31 @@ class DrbdParser -token TK_GLOBAL TK_RESOURCE TK_ON TK_NET TK_DISK_S TK_SYNCER TK_STARTUP TK_DISABLE_IO_HINTS TK_DISABLE_IP_VERIFICATION TK_PROTOCOL TK_INCON_DEGR_CMD TK_ADDRESS TK_DISK TK_DEVICE TK_META_DISK TK_MINOR_COUNT TK_INTEGER TK_STRING TK_ON_IO_ERROR TK_SIZE TK_TIMEOUT TK_CONNECT_INT TK_PING_INT TK_MAX_BUFFERS TK_IPADDR TK_UNPLUG_WATERMARK TK_MAX_EPOCH_SIZE TK_SNDBUF_SIZE TK_SKIP_SYNC TK_USE_CSUMS TK_RATE TK_SYNC_GROUP TK_AL_EXTENTS TK_WFC_TIMEOUT TK_DEGR_WFC_TIMEOUT TK_KO_COUNT TK_ON_DISCONNECT TK_DIALOG_REFRESH +token TK_GLOBAL TK_RESOURCE TK_ON TK_NET TK_DISK_S TK_SYNCER TK_STARTUP TK_DISABLE_IP_VERIFICATION TK_PROTOCOL TK_ADDRESS TK_DISK TK_DEVICE TK_META_DISK TK_MINOR_COUNT TK_INTEGER TK_STRING TK_ON_IO_ERROR TK_SIZE TK_TIMEOUT TK_CONNECT_INT TK_PING_INT TK_MAX_BUFFERS TK_IPADDR TK_UNPLUG_WATERMARK TK_MAX_EPOCH_SIZE TK_SNDBUF_SIZE TK_RATE TK_AL_EXTENTS TK_WFC_TIMEOUT TK_DEGR_WFC_TIMEOUT TK_KO_COUNT TK_ON_DISCONNECT TK_DIALOG_REFRESH TK_USAGE_COUNT TK_COMMON TK_HANDLERS TK_FENCING TK_USE_BMBV TK_NO_DISK_BARRIER TK_NO_DISK_FLUSHES TK_NO_DISK_DRAIN TK_NO_MD_FLUSHES TK_MAX_BIO_BVECS TK_PINT_TIMEOUT TK_ALLOW_TWO_PRIMARIES TK_CRAM_HMAC_ALG TK_SHARED_SECRET TK_AFTER_SB_0PRI TK_AFTER_SB_1PRI TK_AFTER_SB_2PRI TK_DATA_INTEGRITY_ALG TK_RR_CONFLICT TK_NO_TCP_CORK TK_CPU_MASK TK_VERIFY_ALG TK_AFTER TK_FLEXIBLE_META_DISK TK_PRI_ON_INCON_DEGR TK_PRI_LOST_AFTER_SB TK_PRI_LOST TK_OUTDATE_PEER TK_LOCAL_IO_ERROR TK_SPLIT_BRAIN TK_BEFORE_RESYNC_TARGET TK_AFTER_RESYNC_TARGET TK_WAIT_AFTER_SB TK_BECOME_PRIMARY_ON TK_IPV6ADDR TK_IPV6 rule - config: global_sec resources { $drbd['global'] = val[0]; $drbd['resources'] = val[1]; return $drbd; } + config: global_sec common_sec resources { $drbd['global'] = val[0]; $drbd['common'] = val[1]; $drbd['resources'] = val[2]; return $drbd; } global_sec: /* none */ { return {}; } | TK_GLOBAL '{' glob_stmts '}' { return val[2]; } glob_stmts: /* none */ { return {}; } | glob_stmts glob_stmt ';' { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } - glob_stmt: TK_DISABLE_IO_HINTS { return ["#{val[0]}", true]; } - | TK_DISABLE_IP_VERIFICATION { return ["#{val[0]}", true]; } + glob_stmt: TK_USAGE_COUNT TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_DISABLE_IP_VERIFICATION { return ["#{val[0]}", true]; } | TK_MINOR_COUNT TK_STRING { return ["#{val[0]}", val[1]]; } | TK_DIALOG_REFRESH TK_STRING { return ["#{val[0]}", val[1]];} + common_sec: /* none */ { return {}; } + | TK_COMMON '{' common_stmts '}' { return val[2]; } + common_stmts: /* none */ { return {}; } + | common_stmts common_stmt { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } + + common_stmt: TK_DISK_S disk_stmts '}' { return ["#{val[0]}", val[1]]; } + | TK_NET '{' net_stmts '}' { return ["#{val[0]}", val[2]]; } + | TK_SYNCER '{' sync_stmts '}' { return ["#{val[0]}", val[2]]; } + | TK_STARTUP '{' startup_stmts '}' { return ["#{val[0]}", val[2]]; } + | TK_HANDLERS '{' handlers_stmts '}' { return ["#{val[0]}", val[2]]; } + resources: /* none */ { return {}; } | resources resource { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } @@ -23,8 +34,8 @@ resource_name: TK_STRING { return val[0]; } res_stmts: /* none */ { return {}; } - | res_stmts res_stmt ';' { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } - | res_stmts section {nk = val[1][0]; + | res_stmts res_stmt ';' { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } + | res_stmts section {nk = val[1][0]; if nk == "on" then if (!val[0]["on"]) then val[0]["on"] = {}; end val[0]["on"][val[1][1]] = val[1][2]; @@ -34,12 +45,15 @@ return val[0]; } res_stmt: TK_PROTOCOL TK_STRING { return ["#{val[0]}", val[1]]; } - | TK_INCON_DEGR_CMD TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_DEVICE TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_META_DISK meta_disk_and_index { return ["#{val[0]}", val[1]]; } + | TK_DISK TK_STRING { return ["#{val[0]}", val[1]]; } section: TK_DISK_S disk_stmts '}' { return ["#{val[0]}", val[1]]; } | TK_NET '{' net_stmts '}' { return ["#{val[0]}", val[2]]; } | TK_SYNCER '{' sync_stmts '}' { return ["#{val[0]}", val[2]]; } | TK_STARTUP '{' startup_stmts '}' { return ["#{val[0]}", val[2]]; } + | TK_HANDLERS '{' handlers_stmts '}' { return ["#{val[0]}", val[2]]; } | TK_ON hostname '{' host_stmts '}' { return ["#{val[0]}", "#{val[1]}", val[3]]; } hostname: TK_STRING { return val[0]; } @@ -49,6 +63,13 @@ disk_stmt: TK_ON_IO_ERROR TK_STRING { return ["#{val[0]}", val[1]]; } | TK_SIZE TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_FENCING TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_USE_BMBV TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_NO_DISK_BARRIER TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_NO_DISK_FLUSHES TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_NO_DISK_DRAIN TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_NO_MD_FLUSHES TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_MAX_BIO_BVECS TK_STRING { return ["#{val[0]}", val[1]]; } net_stmts: /* none */ { return {}; } | net_stmts net_stmt ';' { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } @@ -56,20 +77,29 @@ net_stmt: TK_TIMEOUT TK_STRING { return ["#{val[0]}", val[1]]; } | TK_CONNECT_INT TK_STRING { return ["#{val[0]}", val[1]]; } | TK_PING_INT TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_PINT_TIMEOUT TK_STRING { return ["#{val[0]}", val[1]]; } | TK_MAX_BUFFERS TK_STRING { return ["#{val[0]}", val[1]]; } | TK_UNPLUG_WATERMARK TK_STRING { return ["#{val[0]}", val[1]]; } | TK_MAX_EPOCH_SIZE TK_STRING { return ["#{val[0]}", val[1]]; } | TK_SNDBUF_SIZE TK_STRING { return ["#{val[0]}", val[1]]; } | TK_KO_COUNT TK_STRING { return ["#{val[0]}", val[1]]; } - | TK_ON_DISCONNECT TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_ALLOW_TWO_PRIMARIES { return ["#{val[0]}", true]; } + | TK_CRAM_HMAC_ALG TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_SHARED_SECRET TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_AFTER_SB_0PRI TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_AFTER_SB_1PRI TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_AFTER_SB_2PRI TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_DATA_INTEGRITY_ALG TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_RR_CONFLICT TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_NO_TCP_CORK { return ["#{val[0]}", true]; } sync_stmts: /* none */ { return {}; } | sync_stmts sync_stmt ';' { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } - sync_stmt: TK_SKIP_SYNC { return ["#{val[0]}", true];} - | TK_USE_CSUMS { return ["#{val[0]}", true];} - | TK_RATE TK_STRING { return ["#{val[0]}", val[1]]; } - | TK_SYNC_GROUP TK_STRING { return ["#{val[0]}", val[1]]; } + sync_stmt: TK_RATE TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_CPU_MASK TK_STRING { return ["#{val[0]}", vavl[1]]; } + | TK_VERIFY_ALG TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_AFTER TK_STRING { return ["#{val[0]}", val[1]]; } | TK_AL_EXTENTS TK_STRING { return ["#{val[0]}", val[1]]; } host_stmts: /* none */ { return {}; } @@ -79,16 +109,35 @@ | TK_DEVICE TK_STRING { return ["#{val[0]}", val[1]]; } | TK_ADDRESS ip_and_port { return ["#{val[0]}", val[1]]; } | TK_META_DISK meta_disk_and_index { return ["#{val[0]}", val[1]]; } + | TK_FLEXIBLE_META_DISK flexible_meta_disk { return ["#{val[0]}", val[1]]; } + + handlers_stmts: /* none */ { return {}; } + | handlers_stmts handlers_stmt ';' { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } + + handlers_stmt: TK_PRI_ON_INCON_DEGR TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_PRI_LOST_AFTER_SB TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_PRI_LOST TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_OUTDATE_PEER TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_LOCAL_IO_ERROR TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_SPLIT_BRAIN TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_BEFORE_RESYNC_TARGET TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_AFTER_RESYNC_TARGET TK_STRING { return ["#{val[0]}", val[1]]; } ip_and_port: TK_STRING ':' TK_STRING { return "#{val[0]}:#{val[2]}"; } + | TK_IPV6 TK_IPV6ADDR ":" TK_STRING { return "#{val[0]} #{val[1]}:#{val[3]}"; } + | TK_STRING TK_STRING ':' TK_STRING { return "#{val[0]} #{val[1]}:#{val[3]}"; } meta_disk_and_index: TK_STRING TK_STRING { return "#{val[0]} #{val[1]}"; } | TK_STRING { return val[0]; } + flexible_meta_disk: TK_STRING { return val[0]; } + startup_stmts: /* */ { return {}; } | startup_stmts startup_stmt ';' { nk = val[1][0]; val[0][nk] = val[1][1]; return val[0]; } startup_stmt: TK_WFC_TIMEOUT TK_STRING { return ["#{val[0]}", val[1]]; } + | TK_WAIT_AFTER_SB { return ["#{val[0]}", true]; } + | TK_BECOME_PRIMARY_ON TK_STRING { return ["#{val[0]}", val[1]]; } | TK_DEGR_WFC_TIMEOUT TK_STRING { return ["#{val[0]}", val[1]]; } end @@ -98,21 +147,17 @@ ---- inner def parse(str) -# @yydebug = true + @yydebug = false @q = [] until str.empty? || !str case str when /\A\s+/ when /\Adisable-ip-verification/ @q.push [:TK_DISABLE_IP_VERIFICATION, 'disable-ip-verification'] - when /\Adisable-io-hints/ - @q.push [:TK_DISABLE_IO_HINTS, 'disable-io-hints'] - when /\Aincon-degr-cmd/ - @q.push [:TK_INCON_DEGR_CMD, 'incon-degr-cmd'] + when /\Ausage-count/ + @q.push [:TK_USAGE_COUNT, 'usage-count'] when /\Adialog-refresh/ @q.push [:TK_DIALOG_REFRESH, 'dialog-refresh'] - when /\Aon-disconnect/ - @q.push [:TK_ON_DISCONNECT, 'on-disconnect'] when /\Aon-io-error/ @q.push [:TK_ON_IO_ERROR, 'on-io-error'] when /\Aglobal/ @@ -121,10 +166,12 @@ @q.push [:TK_MINOR_COUNT, 'minor-count'] when /\Aresource/ @q.push [:TK_RESOURCE, 'resource'] + when /\Acommon/ + @q.push [:TK_COMMON, 'common'] when /\Aprotocol/ @q.push [:TK_PROTOCOL, 'protocol'] when /\Adisk\s*\{/ - @q.push [:TK_DISK_S, 'disk'] + @q.push [:TK_DISK_S, 'disk_s'] when /\Adisk/ @q.push [:TK_DISK, 'disk'] when /\Anet/ @@ -133,12 +180,80 @@ @q.push [:TK_SYNCER, 'syncer'] when /\Astartup/ @q.push [:TK_STARTUP, 'startup'] + when /\Ahandlers/ + @q.push [:TK_HANDLERS, 'handlers'] + when /\Afencing/ + @q.push [:TK_FENCING, 'fencing'] + when /\Ause-bmbv/ + @q.push [:TK_USE_BMBV, 'use-bmbv'] + when /\Ano-disk-barrier/ + @q.push [:TK_NO_DISK_BARRIER, 'no-disk-barrier'] + when /\Ano-disk-flushes/ + @q.push [:TK_NO_DISK_FLUSHES, 'no-disk-flushes'] + when /\Ano-disk-drain/ + @q.push [:TK_NO_DISK_DRAIN, 'no-disk-drain'] + when /\Ano-md-flushes/ + @q.push [:TK_NO_MD_FLUSHES, 'no-md-flushes'] + when /\Amax-bio-bvecs/ + @q.push [:TK_MAX_BIO_BVECS, 'max-bio-bvecs'] + when /\Aping-timeout/ + @q.push [:TK_PING_TIMEOUT, 'ping-timeout'] + when /\Aallow-two-primaries/ + @q.push [:TK_ALLOW_TWO_PRIMARIES, 'allow-two-primaries'] + when /\Acram-hmac-alg/ + @q.push [:TK_CRAM_HMAC_ALG, 'cram-hmac-alg'] + when /\Ashared-secret/ + @q.push [:TK_SHARED_SECRET, 'shared-secret'] + when /\Aafter-sb-0pri/ + @q.push [:TK_AFTER_SB_0PRI, 'after-sb-0pri'] + when /\Aafter-sb-1pri/ + @q.push [:TK_AFTER_SB_0PRI, 'after-sb-1pri'] + when /\Aafter-sb-2pri/ + @q.push [:TK_AFTER_SB_0PRI, 'after-sb-2pri'] + when /\Adata-integrity-alg/ + @q.push [:TK_DATA_INTEGRITY_ALG, 'data-integrity-alg'] + when /\Arr-conflict/ + @q.push [:TK_RR_CONFLICT, 'rr-conflict'] + when /\Apri-on-incon-degr/ + @q.push [:TK_PRI_ON_INCON_DEGR, 'pri-on-incon-degr'] + when /\Apri-lost-after-sb/ + @q.push [:TK_PRI_LOST_AFTER_SB, 'pri-lost-after-sb'] + when /\Apri-lost/ + @q.push [:TK_PRI_LOST, 'pri-lost'] + when /\Aoutdate-peer/ + @q.push [:TK_OUTDATE_PEER, 'outdate-peer'] + when /\Alocal-io-error/ + @q.push [:TK_LOCAL_IO_ERROR, 'local-io-error'] + when /\Asplit-brain/ + @q.push [:TK_SPLIT_BRAIN, 'split-brain'] + when /\Abefore-resync-target/ + @q.push [:TK_BEFORE_RESYNC_TARGET, 'before-rsync-target'] + when /\Aafter-resync-target/ + @q.push [:TK_AFTER_RESYNC_TARGET, 'after-resync-target'] + when /\Await-after-sb/ + @q.push [:TK_WAIT_AFTER_SB, 'wait-after-sb'] + when /\Abecome-primary-on/ + @q.push [:TK_BECOME_PRIMARY_ON, 'become-primary-on'] + when /\Ano-tcp-cork/ + @q.push [:TK_NO_TCP_CORK, 'no-tcp-cork'] + when /\Acpu-mask/ + @q.push [:TK_CPU_MASK, 'cpu-mask'] + when /\Averify-alg/ + @q.push [:TK_VERIFY_ALG, 'verify-alg'] when /\Asize/ @q.push [:TK_SIZE, 'size'] when /\Atimeout/ @q.push [:TK_TIMEOUT, 'timeout'] when /\Aconnect-int/ @q.push [:TK_CONNECT_INT, 'connect-int'] + when /\Aafter-sb-0pri/ + @q.push [:TK_AFTER_SB_0PRI, 'after-sb-0pri'] + when /\Aafter-sb-1pri/ + @q.push [:TK_AFTER_SB_0PRI, 'after-sb-1pri'] + when /\Aafter-sb-2pri/ + @q.push [:TK_AFTER_SB_0PRI, 'after-sb-2pri'] + when /\Arr-conflict/ + @q.push [:TK_RR_CONFLICT, 'rr-conflict'] when /\Aping-int/ @q.push [:TK_PING_INT, 'ping-int'] when /\Amax-buffers/ @@ -151,32 +266,34 @@ @q.push [:TK_SNDBUF_SIZE, 'sndbuf-size'] when /\Ako-count/ @q.push [:TK_KO_COUNT, 'ko-count'] - when /\Askip-sync/ - @q.push [:TK_SKIP_SYNC, 'skip-sync'] - when /\Ause-csums/ - @q.push [:TK_USE_CSUMS, 'use-csums'] when /\Arate/ @q.push [:TK_RATE, 'rate'] - when /\Agroup/ - @q.push [:TK_SYNC_GROUP, 'group'] when /\Aal-extents/ @q.push [:TK_AL_EXTENTS, 'al-extents'] + when /\Aafter/ + @q.push [:TK_AFTER, 'after'] when /\Adevice/ @q.push [:TK_DEVICE, 'device'] when /\Aaddress/ @q.push [:TK_ADDRESS, 'address'] when /\Ameta-disk/ @q.push [:TK_META_DISK, 'meta-disk'] - when /\Awfc-timeout/ - @q.push [:TK_WFC_TIMEOUT, 'wfc-timeout'] + when /\Aflexible-meta-disk/ + @q.push [:TK_FLEXIBLE_META_DISK, 'flexible-meta-disk'] when /\Adegr-wfc-timeout/ @q.push [:TK_DEGR_WFC_TIMEOUT, 'degr-wfc-timeout'] + when /\Awfc-timeout/ + @q.push [:TK_WFC_TIMEOUT, 'wfc-timeout'] + when /\Aipv6/ + @q.push [:TK_IPV6, 'ipv6'] when /\Aon\s*/ @q.push [:TK_ON, 'on'] when /\A"[^"]*"/ @q.push [:TK_STRING, $&] + when /\A\[[\w\.\/:]+:[\w\.\/:]+\]/ + @q.push [:TK_IPV6ADDR, $&] when /\A[\w\.\/\[\]-]+/ - @q.push [:TK_STRING, $&] + @q.push [:TK_STRING, $&] when /\A.|\n/o s = $& @q.push [s, s] @@ -235,7 +352,7 @@ def doList (path) if path.length == 0 then - puts "[ \"global\", \"resources\" ]" + puts "[ \"global\", \"resources\", \"common\" ]" return end @@ -331,6 +448,10 @@ errlog path[it]+" is changed to "+path[it].chomp()[1..-2] path[it]=path[it].chomp()[1..-2] end + if path[it] != "" and path[it][0..1] == "\\\"" then + errlog path[it]+" is changed to "+path[it].chomp()[1..-3]+"\"" + path[it]=path[it].chomp()[1..-3]+"\"" + end end if args[0..1] == "\\\"" then @@ -431,7 +552,7 @@ if $drbd.has_key?("global") then file.puts "global {" $drbd["global"].each_key do |key| - if key == "disable-ip-verification" or key == "disable-io-hints" then + if key == "disable-ip-verification" then if $drbd["global"][key] == "" or $drbd["global"][key] == "true" then file.puts " "+key+";" end @@ -441,6 +562,53 @@ end file.puts "}" end + + if $drbd.has_key?("common") then + file.puts "common {" + + if $drbd["common"].has_key?("disk_s") then + file.puts " disk {" + $drbd["common"]["disk_s"].each_key do |key| + file.puts " "+key+"\t"+$drbd["common"]["disk_s"][key]+";" + end + file.puts " }" + end + + if $drbd["common"].has_key?("syncer") then + file.puts " syncer {" + $drbd["common"]["syncer"].each_key do |key| + file.puts " "+key+"\t"+$drbd["common"]["syncer"][key]+";" + end + file.puts " }" + end + + if $drbd["common"].has_key?("net") then + file.puts " net {" + $drbd["common"]["net"].each_key do |key| + file.puts " "+key+"\t"+$drbd["common"]["net"][key]+";" + end + file.puts " }" + end + + if $drbd["common"].has_key?("startup") then + file.puts " startup {" + $drbd["common"]["startup"].each_key do |key| + file.puts " "+key+"\t"+$drbd["common"]["startup"][key]+";" + end + file.puts " }" + end + + if $drbd["common"].has_key?("handlers") then + file.puts " handlers {" + $drbd["common"]["handlers"].each_key do |key| + file.puts " "+key+"\t"+$drbd["common"]["handlers"][key]+";" + end + file.puts " }" + end + + file.puts "}" + end + if $drbd.has_key?("resources") then $drbd["resources"].each_key do |res_name| file.puts "resource "+res_name+" {" @@ -448,15 +616,20 @@ if $drbd["resources"][res_name].has_key?("protocol") then file.puts " protocol\t"+$drbd["resources"][res_name]["protocol"]+";" end - - if $drbd["resources"][res_name].has_key?("incon-degr-cmd") then - file.puts " incon-degr-cmd\t"+$drbd["resources"][res_name]["incon-degr-cmd"]+";" + if $drbd["resources"][res_name].has_key?("device") then + file.puts " device\t"+$drbd["resources"][res_name]["device"]+";" + end + if $drbd["resources"][res_name].has_key?("disk") then + file.puts " disk\t"+$drbd["resources"][res_name]["disk"]+";" + end + if $drbd["resources"][res_name].has_key?("meta-disk") then + file.puts " meta-disk\t"+$drbd["resources"][res_name]["meta-disk"]+";" end - if $drbd["resources"][res_name].has_key?("disk") then + if $drbd["resources"][res_name].has_key?("disk_s") then file.puts " disk {" - $drbd["resources"][res_name]["disk"].each_key do |key| - file.puts " "+key+"\t"+$drbd["resources"][res_name]["disk"][key]+";" + $drbd["resources"][res_name]["disk_s"].each_key do |key| + file.puts " "+key+"\t"+$drbd["resources"][res_name]["disk_s"][key]+";" end file.puts " }" end @@ -485,6 +658,14 @@ file.puts " }" end + if $drbd["resources"][res_name].has_key?("handlers") then + file.puts " handlers {" + $drbd["resources"][res_name]["handlers"].each_key do |key| + file.puts " "+key+"\t"+$drbd["resources"][res_name]["handlers"][key]+";" + end + file.puts " }" + end + if $drbd["resources"][res_name].has_key?("on") then $drbd["resources"][res_name]["on"].each_key do |node_name| file.puts " on "+node_name+" {" @@ -512,10 +693,12 @@ # `Write (.drbd) means to write the file, other wise, the file is not written anyway +errlog($drbd.to_s) + $stdin.each do |line| errlog(line) line.chomp - cmd = line.gsub(/^`?([a-zA-Z]+)\s.*$/, '\1') + cmd = line.gsub(/^`?([a-zA-Z]+)\s+$/, '\1') path = line.gsub(/^`?([a-zA-Z]+)\s+\(([^,]*)(,.*)?\)$/, '\2').split('.')-[""]-["\n"] args = line.gsub(/^`?([a-zA-Z]+)\s+\(([^,]*)(,.*)?\)$/, '\3') if args.length != 0 then Index: yast2-drbd-2.13.1/src/Drbd.ycp =================================================================== --- yast2-drbd-2.13.1.orig/src/Drbd.ycp 2008-12-19 17:28:40.000000000 +0800 +++ yast2-drbd-2.13.1/src/Drbd.ycp 2008-12-19 17:28:40.000000000 +0800 @@ -49,9 +49,9 @@ global map resource_config = $[]; global string drbd_dir = "/etc"; global boolean start_daemon = false; -global map<string, list<string> > config_name = $["disk":["on-io-error", "size"], - "syncer":["skip-sync", "use-csums", "rate", "group", "al-extents"], - "net":["timeout", "connect-int", "ping-int", "max-buffers", "unplug-watermark", "max-epoch-size", "sndbuf-size", "ko-count", "on-disconnect"], +global map<string, list<string> > config_name = $["disk_s":["on-io-error", "size"], + "syncer":["rate", "al-extents"], + "net":["timeout", "connect-int", "ping-int", "max-buffers", "unplug-watermark", "max-epoch-size", "sndbuf-size", "ko-count"], "startup":["wfc-timeout", "degr-wfc-timeout"]]; @@ -90,7 +90,7 @@ y2milestone("read drbd conf file: %1", drbd_dir); //read global configs - foreach (string key, [ "disable-ip-verification", "minor-count", "dialog-refresh", "disable-io-hints" ], + foreach (string key, [ "disable-ip-verification", "minor-count", "dialog-refresh"], { string val = (string)SCR::Read(topath(sformat(".drbd.global.%1", key))); global_config[key] = val; @@ -109,7 +109,7 @@ map config = $[]; list<string> res_configs = (list<string>)SCR::Dir(topath(sformat(".drbd.resources.%1", resname))); - foreach (string resconf, ["protocol", "incon-degr-cmd"], + foreach (string resconf, ["protocol"], { if (contains(res_configs, resconf)) { string val = (string)SCR::Read(topath(sformat(".drbd.resources.%1.%2",resname,resconf))); @@ -238,7 +238,7 @@ //global config here Progress::NextStage(); y2debug("to write global config: global_config=%1", global_config); - foreach(string key, [ "disable-ip-verification", "minor-count", "dialog-refresh", "disable-io-hints" ], + foreach(string key, [ "disable-ip-verification", "minor-count", "dialog-refresh" ], { if (global_config[key]:nil != nil) { SCR::Write(topath(sformat(".drbd.global.%1", key)), global_config[key]:nil); Index: yast2-drbd-2.13.1/src/global_conf.ycp =================================================================== --- yast2-drbd-2.13.1.orig/src/global_conf.ycp 2007-04-17 00:46:56.000000000 +0800 +++ yast2-drbd-2.13.1/src/global_conf.ycp 2008-12-19 17:28:40.000000000 +0800 @@ -15,7 +15,6 @@ void global_conf_Read() { disipver = Drbd::global_config["disable-ip-verification"]:"false"; - disiohin = Drbd::global_config["disable-io-hints"]:"false"; diagref = Drbd::global_config["dialog-refresh"]:"1"; mc = Drbd::global_config["minor-count"]:"5"; } @@ -28,21 +27,18 @@ `VBox( `Left(`IntField(`id("MinorCount"), _("Minor Count"), 1, 20, tointeger(mc))), `Left(`IntField(`id("DialogRefresh"), _("Dialog Refresh"), 0, 1000, tointeger(diagref))), - `Left(`CheckBox(`id("DisableIpVerification"), `opt(`notify), _("Disable IP Verification"), disipver=="true")), - `Left(`CheckBox(`id("DisableIoHint"), `opt(`notify), _("Disable IO Hint"), disiohin=="true")))) - ), `VStretch() + `Left(`CheckBox(`id("DisableIpVerification"), `opt(`notify), _("Disable IP Verification"), disipver=="true")) + ))), `VStretch() ); } boolean global_conf_Write () { disipver = (boolean)UI::QueryWidget(`id("DisableIpVerification"), `Value) ? "true" : nil; - disiohin = (boolean)UI::QueryWidget(`id("DisableIoHint"), `Value) ? "true" : nil; diagref = sformat("%1", UI::QueryWidget(`id("DialogRefresh"), `Value)); mc = sformat("%1", UI::QueryWidget(`id("MinorCount"), `Value)); Drbd::global_config["disable-ip-verification"] = disipver; - Drbd::global_config["disable-io-hints"] = disiohin; Drbd::global_config["dialog-refresh"] = diagref; Drbd::global_config["minor-count"] = mc; @@ -73,7 +69,7 @@ ret = (string)UI::QueryWidget (`id (`wizardTree), `CurrentItem); } - if (ret=="DialogRefresh" || ret=="MinorCount" || ret=="DisableIpVerification" || ret=="DisableIoHint") { + if (ret=="DialogRefresh" || ret=="MinorCount" || ret=="DisableIpVerification" ) { continue; } Index: yast2-drbd-2.13.1/src/resource_conf.ycp =================================================================== --- yast2-drbd-2.13.1.orig/src/resource_conf.ycp 2008-12-19 17:28:40.000000000 +0800 +++ yast2-drbd-2.13.1/src/resource_conf.ycp 2008-12-19 17:28:40.000000000 +0800 @@ -78,14 +78,14 @@ ret = (string)UI::QueryWidget (`id (`wizardTree), `CurrentItem); } - if (ret=="resource_conf" || ret=="DialogRefresh" || ret=="MinorCount" || ret=="DisableIpVerification" || ret=="DisableIoHint") { + if (ret=="resource_conf" || ret=="DialogRefresh" || ret=="MinorCount" || ret=="DisableIpVerification" ) { continue; } if (ret == `delete) { string resname = (string) UI::QueryWidget(`id(`res_list_table), `CurrentItem); - Drbd::resource_config[resname] = nil; + Drbd::resource_config[sformat("%1", resname)] = nil; ret = `list; break; } @@ -185,9 +185,7 @@ return `VBox( `HBox( `ComboBox(`id(`protocol), _("Protocol"), ["A", "B", "C"]), - `HSpacing(), - `TextEntry(`id(`cmd), _("Inconsistent degraded command"), - res_config["incon-degr-cmd"]:"\"echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f\"") + `HSpacing() ), `Frame( "Startup", @@ -201,7 +199,7 @@ `HBox( `ComboBox(`id(`on_io_error), "on-io-error", ["detach", "panic", "pass_on"]), `HSpacing(), - `TextEntry(`id(`size), "size", res_config["disk", "size"]:"") + `TextEntry(`id(`size), "size", res_config["disk_s", "size"]:"") ) ), `Frame( @@ -218,8 +216,7 @@ ), `HBox( `TextEntry(`id(`max_epoch_size), "max-epoch-size", res_config["net", "max-epoch-size"]:""), - `TextEntry(`id(`ko_count), "ko-count", res_config["net", "ko-count"]:""), - `ComboBox(`id(`on_disconnect), "on-disconnect", ["reconnect", "stand_alone", "freeze_io"]) + `TextEntry(`id(`ko_count), "ko-count", res_config["net", "ko-count"]:"") ) ) ), @@ -227,8 +224,7 @@ "Syncer", `HBox( `TextEntry(`id(`rate), "Rate", res_config["syncer", "rate"]:""), - `TextEntry(`id(`al_extents), "Al-extents", res_config["syncer", "al-extents"]:""), - `TextEntry(`id(`group), "Group", res_config["syncer", "group"]:"") + `TextEntry(`id(`al_extents), "Al-extents", res_config["syncer", "al-extents"]:"") ) ), `VStretch(), @@ -247,22 +243,19 @@ if (UI::QueryWidget(`id(`protocol), `Value) == nil) { if (res_config["protocol"]:nil == nil) res_config["protocol"] = "C"; - if (res_config["incon-degr-cmd"]:nil == nil) res_config["incon-degr-cmd"] = "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f"; - if (res_config["disk", "on-io-error"]:nil == nil) res_config["disk"] = $["on-io-error" : "pass_on"]; - if (res_config["net", "on-disconnect"]:nil == nil) res_config["net"] = $["on-disconnect" : "reconnect"]; + if (res_config["disk_s", "on-io-error"]:nil == nil) res_config["disk_s"] = $["on-io-error" : "pass_on"]; return res_config; } res_config["protocol"] = (string) UI::QueryWidget(`id(`protocol), `Value); - res_config["incon-degr-cmd"] = (string) UI::QueryWidget(`id(`cmd), `Value); res_config["startup"] = $[ "wfc-timeout" : (string) UI::QueryWidget(`id(`wfc_timeout), `Value), "degr-wfc-timeout" : (string) UI::QueryWidget(`id(`degr_wfc_timeout), `Value) ]; - res_config["disk"] = $[ + res_config["disk_s"] = $[ "on-io-error" : (string) UI::QueryWidget(`id(`on_io_error), `Value), "size" : (string) UI::QueryWidget(`id(`size), `Value) ]; @@ -275,12 +268,10 @@ "max-buffers" : (string) UI::QueryWidget(`id(`max_buffers), `Value), "max-epoch-size" : (string) UI::QueryWidget(`id(`max_epoch_size), `Value), "ko-count" : (string) UI::QueryWidget(`id(`ko_count), `Value), - "on-disconnect" : (string) UI::QueryWidget(`id(`on_disconnect), `Value), ]; res_config["syncer"] = $[ "al-extents" : (string) UI::QueryWidget(`id(`al_extents), `Value), - "group" : (string) UI::QueryWidget(`id(`group), `Value), "rate" : (string) UI::QueryWidget(`id(`rate), `Value) ]; @@ -376,8 +367,7 @@ my_SetContents("resource_conf", res_advance_config_get_dialog(res_config)); UI::ChangeWidget(`id(`protocol), `Value, res_config["protocol"]:"C"); - UI::ChangeWidget(`id(`on_io_error), `Value, res_config["disk", "on-io-error"]:"pass_on"); - UI::ChangeWidget(`id(`on_disconnect), `Value, res_config["net", "on-disconnect"]:"reconnect"); + UI::ChangeWidget(`id(`on_io_error), `Value, res_config["disk_s", "on-io-error"]:"pass_on"); Wizard::DisableNextButton(); Wizard::DisableAbortButton();
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor