@@ -26,7 +26,7 @@ def xml_from_should(name, should)
2626
2727 def get ( context )
2828 results = [ ]
29- config = context . device . get_config ( context . type . definition [ :base_xpath ] + '/entry' )
29+ config = context . transport . get_config ( context . type . definition [ :base_xpath ] + '/entry' )
3030 config . elements . collect ( '/response/result/entry' ) do |entry | # rubocop:disable Style/CollectionMethods
3131 vr_name = REXML ::XPath . match ( entry , 'string(@name)' ) . first
3232 config . elements . collect ( "/response/result/entry[@name='#{ vr_name } ']/routing-table/#{ @version_label } /static-route/entry" ) do |static_route_entry | # rubocop:disable Style/CollectionMethods
@@ -51,17 +51,17 @@ def get(context)
5151 def create ( context , name , should )
5252 paths = name [ :route ] . split ( '/' )
5353 context . type . definition [ :base_xpath ] = "/config/devices/entry/network/virtual-router/entry[@name='#{ paths [ 0 ] } ']/routing-table/#{ @version_label } /static-route/entry[@name='#{ paths [ 1 ] } ']/path-monitor/monitor-destinations" # rubocop:disable Metrics/LineLength
54- context . device . set_config ( context . type . definition [ :base_xpath ] , xml_from_should ( name , should ) )
54+ context . transport . set_config ( context . type . definition [ :base_xpath ] , xml_from_should ( name , should ) )
5555 end
5656
5757 def update ( context , name , should )
5858 paths = name [ :route ] . split ( '/' )
5959 context . type . definition [ :base_xpath ] = "/config/devices/entry/network/virtual-router/entry[@name='#{ paths [ 0 ] } ']/routing-table/#{ @version_label } /static-route/entry[@name='#{ paths [ 1 ] } ']/path-monitor/monitor-destinations" # rubocop:disable Metrics/LineLength
60- context . device . set_config ( context . type . definition [ :base_xpath ] , xml_from_should ( name , should ) )
60+ context . transport . set_config ( context . type . definition [ :base_xpath ] , xml_from_should ( name , should ) )
6161 end
6262
6363 def delete ( context , name )
6464 names = name [ :route ] . split ( '/' )
65- context . device . delete_config ( context . type . definition [ :base_xpath ] + "/entry[@name='#{ names [ 0 ] } ']/routing-table/#{ @version_label } /static-route/entry[@name='#{ names [ 1 ] } ']/path-monitor/monitor-destinations/entry[@name='#{ name [ :path ] } ']" ) # rubocop:disable Metrics/LineLength
65+ context . transport . delete_config ( context . type . definition [ :base_xpath ] + "/entry[@name='#{ names [ 0 ] } ']/routing-table/#{ @version_label } /static-route/entry[@name='#{ names [ 1 ] } ']/path-monitor/monitor-destinations/entry[@name='#{ name [ :path ] } ']" ) # rubocop:disable Metrics/LineLength
6666 end
6767end
0 commit comments