warn about deprecated usage
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								8e5a0f83c5
							
						
					
				
			
			
				commit
				
					
						52849b91c5
					
				
			
		
					 1 changed files with 11 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -31,11 +31,19 @@ state_should="$(cat "$__object/parameter/state")"
 | 
			
		|||
 | 
			
		||||
# Correct pre 2.1 naming - FIXME in 2.1
 | 
			
		||||
case "$state_should" in
 | 
			
		||||
    installed) state_should="present" ;;
 | 
			
		||||
    removed) state_should="absent" ;;
 | 
			
		||||
    # FIXME: print warning to stderr!
 | 
			
		||||
    installed)
 | 
			
		||||
        echo "WARNING: $state_should is deprecated, please change to present/absent (will be removed in cdist 2.1)" >&2
 | 
			
		||||
        state_should="present"
 | 
			
		||||
    ;;
 | 
			
		||||
    removed)
 | 
			
		||||
        echo "WARNING: $state_should is deprecated, please change to present/absent (will be removed in cdist 2.1)" >&2
 | 
			
		||||
        state_should="absent"
 | 
			
		||||
    ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
state_is="$(cat "$__object/explorer/pkg_status")"
 | 
			
		||||
# FIXME: use grep directly, state is a list, not a line!
 | 
			
		||||
state_is="$(cat "$__object/explorer/state")"
 | 
			
		||||
case "$state_is" in
 | 
			
		||||
    present*)
 | 
			
		||||
       name="$(echo "$state_is" | cut -d ' ' -f 2)"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue