Changeset 346


Ignore:
Timestamp:
08/28/15 07:58:03 (9 years ago)
Author:
dennis
Message:

Updated sara_nodes, and bumped version for the specfiles

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.rpm

    r345 r346  
    11PRODUCT=pbs_python
    2 VERSION=4.6.0
    3 RELEASE=3
     2VERSION=4.6.1
     3RELEASE=1
    44
    55#PYTHON_VERSION=2.3
  • trunk/examples/sara_nodes.py

    r321 r346  
    249249        ## Check if the given host has a note
    250250        note = dictin[host]['note'] if dictin[host].has_key('note') else []
    251         if note:
     251        if len(note) > 3:
    252252            add_dict['date_add']    = note[0]
    253253            add_dict['date_edit']   = note[1]
    254254            add_dict['username']    = note[2]
    255             add_dict['ticket']      = note[3]
    256             add_dict['note']        = ",".join(note[4:])
     255
     256            if note[3].isdigit():
     257                add_dict['ticket']      = note[3]
     258                add_dict['note']        = ",".join(note[4:])
     259            else:
     260                add_dict['ticket']      = ""
     261                add_dict['note']        = ",".join(note[3:])
    257262
    258263            ## Create an extra date field, combined for date_edit and date_add
     
    310315            w_username = len(line['username'])
    311316        if line['ticket'] and len(line['ticket']) > w_ticket:
    312             w_ticket = len(line['ticket'])
     317            w_ticket = len(line['ticket'].strip())
    313318        if line['note'] and len(line['note']) > w_note:
    314319            w_note = len(line['note'])
     
    345350            show_line_fields.append([w_date_edit,line['date_edit']])
    346351            show_line_fields.append([w_username,line['username']])
    347             if w_ticket > 0:
    348                 show_line_fields.append([w_ticket,line['ticket']])
     352            if w_ticket > 0 and line['ticket'].strip():
     353                show_line_fields.append([w_ticket,'#' + line['ticket']])
     354            else:
     355                show_line_fields.append([w_ticket,''])
    349356            show_line_fields.append([w_note,line['note']])
    350357
     
    402409        if ARGS_VERBOSE:
    403410            _print('class:SaraNodes func:_get_ticket input:%s' % prev_ticket, file=sys.stderr)
    404         cur_ticket = '#%s' % self.ticket
     411        cur_ticket = '%s' % self.ticket
    405412        if prev_ticket and cur_ticket == prev_ticket:
    406413            return prev_ticket
    407         elif self.ticket and self.ticket.isdigit():
     414        elif self.ticket:
    408415            return cur_ticket
    409416        elif self.ticket in ['c','clear','N',]:
     
    572579    parser.add_argument('-N','--clear-note', action='store_true', help='clear the message of a node')
    573580    parser.add_argument('-f','--format', metavar='FORMAT', help='change the output of sara_nodes (see footer of --help)')
    574     parser.add_argument('-t','--ticket', metavar='TICKET', help='add a ticket number to a node')
     581    parser.add_argument('-t','--ticket', metavar='TICKET', type=int, help='add a ticket number to a node')
    575582    parser.add_argument('--version', action='version', version=pbs.version)
    576583
  • trunk/pbs_python.spec

    r345 r346  
    44
    55Name: pbs_python
    6 Version: 4.6.0
    7 Release: 3%{?dist}
     6Version: 4.6.1
     7Release: 1%{?dist}
    88License: See LICENSE
    99Group: Development/Libraries
Note: See TracChangeset for help on using the changeset viewer.