Changeset 1568 in genappalpha


Ignore:
Timestamp:
Sep 24, 2018, 9:12:06 AM (7 weeks ago)
Author:
ehb
Message:

Use submit policy from appconfig.json.template

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbin/getapp.pl

    r1394 r1568  
    218218    my $admin      = $_[2];
    219219
     220    my $f      = "$targetdir/appconfig.json.template";
     221
     222    # restrictive default
     223    my $usesubmitpolicy = "login";
     224
     225    if ( -e $f && -r $f) {
     226        # read for submitpolicy for now
     227        open my $fh, $f;
     228        my @l = <$fh>;
     229        close $fh;
     230        @l = grep !/^\s*#/, @l;
     231        my $appjson = decode_json( ( join '', @l ) );
     232        if ( $$appjson{ 'submitpolicy' } ) {
     233            $usesubmitpolicy = $$appjson{ 'submitpolicy' };
     234        }
     235    }
     236
    220237    my $json = {};
    221238    $$json{ "hostip"   } = $$cfgjson{ 'hostip' }   || die "$0 hostip not defined in $cfgjsonf. $cfgjsonnotes";
     
    236253
    237254    $$json{ "resourcedefault" } = "local";
    238     $$json{ "submitpolicy" } = "login";
     255    $$json{ "submitpolicy" } = $usesubmitpolicy;
    239256
    240257    $$json{ "lockdir" } = "$gb/etc";
Note: See TracChangeset for help on using the changeset viewer.