|
7 | 7 | import yaml
|
8 | 8 | import argparse
|
9 | 9 | import collections
|
10 |
| -import deprecation |
11 | 10 |
|
12 | 11 |
|
13 | 12 | class SiteConfig:
|
@@ -581,45 +580,6 @@ def add_site_attributes(args, site, host=None):
|
581 | 580 | args.crossbar_timeout = host.crossbar_timeout
|
582 | 581 |
|
583 | 582 |
|
584 |
| -@deprecation.deprecated(deprecated_in='v0.6.0', |
585 |
| - details="Use site_config.parse_args instead") |
586 |
| -def reparse_args(args, agent_class=None): |
587 |
| - """ |
588 |
| - THIS FUNCTION IS NOW DEPRECATED... Use the parse_args function instead |
589 |
| - to parse command line and site-config args simultaneously. |
590 |
| -
|
591 |
| - Process the site-config arguments, and modify them in place |
592 |
| - according to the agent-instance's computed instance-id. |
593 |
| -
|
594 |
| - Args: |
595 |
| - args: The argument object returned by |
596 |
| - ArgumentParser.parse_args(), or equivalent. |
597 |
| -
|
598 |
| - agent_class: Class name passed in to match against the list of |
599 |
| - device classes in each host's list. |
600 |
| -
|
601 |
| - Special values accepted for agent_class: |
602 |
| - - '*control*': do not insist on matching host or device. |
603 |
| - """ |
604 |
| - if args.site == 'none': |
605 |
| - return args |
606 |
| - |
607 |
| - site, host, instance = get_config(args, agent_class=agent_class) |
608 |
| - |
609 |
| - add_site_attributes(args, site, host=host) |
610 |
| - |
611 |
| - if instance is not None: |
612 |
| - if args.instance_id is None: |
613 |
| - args.instance_id = instance.data['instance-id'] |
614 |
| - |
615 |
| - for k, v in instance.data['arguments']: |
616 |
| - kprop = k.lstrip('-').replace('-', '_') |
617 |
| - print('site_config is setting values of "%s" to "%s".' % (kprop, v)) |
618 |
| - setattr(args, kprop, v) |
619 |
| - |
620 |
| - return args |
621 |
| - |
622 |
| - |
623 | 583 | def get_control_client(instance_id, site=None, args=None, start=True,
|
624 | 584 | client_type='http'):
|
625 | 585 | """Instantiate and return a client_http.ControlClient, targeting the
|
|
0 commit comments