files.py revision 2
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A
2N/A#
2N/A# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A
2N/A"""Files classes used by nscfg."""
2N/A
2N/Afrom __future__ import print_function
2N/Afrom .nssbase import Nssbase
2N/A
2N/Aclass Files(Nssbase):
2N/A """Local files name service class. Represents the configuration
2N/A of local files. See nsswitch.conf(4) for details."""
2N/A
2N/A # Currently no service exists for files.
2N/A # If a service were to exist, it would be this one.
2N/A SERVICE = 'svc:/system/name-service/switch'
2N/A LEGACY = None
2N/A LEGACYDIR = None
2N/A DEFPG = 'file_paths'
2N/A DEFPROP = None
2N/A # Supported Property groups
2N/A BACKEND = 'nss_files'
2N/A
2N/A def __init__(self):
2N/A Nssbase.__init__(self)
2N/A
2N/A def export_from_smf(self):
2N/A """Export from SMF. Do nothing. no legacy configuration files."""
2N/A self.print_msg('successful export.')
2N/A return self.SUCCESS
2N/A
2N/A def import_to_smf(self):
2N/A """Import to SMF. Do nothing. no legacy configuration files."""
2N/A self.print_msg('successful import.')
2N/A return self.SUCCESS
2N/A
2N/A def unconfig_smf(self):
2N/A """Unconfigure SMF. Do nothing. no legacy configuration files."""
2N/A self.print_msg('successful unconfigure.')
2N/A return self.SUCCESS
2N/A
2N/A def is_populated(self):
2N/A """Is SMF populated with this service? Yes. (no SMF config)"""
2N/A return True