Esempio n. 1
0
def account_clear(cmd):
    """Clear all stored subscriptions. To clear individual, use 'logout'"""
    _remove_adal_token_cache()

    if in_cloud_console():
        logger.warning(_CLOUD_CONSOLE_LOGOUT_WARNING)
    profile = Profile(cli_ctx=cmd.cli_ctx)
    profile.logout_all()
Esempio n. 2
0
    def test_logout_all(self, mock_delete_cred_file):
        #setup
        storage_mock = {'subscriptions': None}
        profile = Profile(storage_mock)
        consolidated = Profile._normalize_properties(self.user1,
                                                     [self.subscription1],
                                                     False)
        consolidated2 = Profile._normalize_properties(self.user2,
                                                      [self.subscription2],
                                                      False)
        profile._set_subscriptions(consolidated + consolidated2)

        self.assertEqual(2, len(storage_mock['subscriptions']))
        #action
        profile.logout_all()

        #verify
        self.assertEqual([], storage_mock['subscriptions'])
        self.assertEqual(mock_delete_cred_file.call_count, 1)
Esempio n. 3
0
    def test_logout_all(self, mock_delete_cred_file):
        #setup
        storage_mock = {'subscriptions': None}
        profile = Profile(storage_mock)
        consolidated = Profile._normalize_properties(self.user1,
                                                     [self.subscription1],
                                                     False)
        consolidated2 = Profile._normalize_properties(self.user2,
                                                      [self.subscription2],
                                                      False)
        profile._set_subscriptions(consolidated + consolidated2)

        self.assertEqual(2, len(storage_mock['subscriptions']))
        #action
        profile.logout_all()

        #verify
        self.assertEqual([], storage_mock['subscriptions'])
        self.assertEqual(mock_delete_cred_file.call_count, 1)
Esempio n. 4
0
def account_clear(cmd):
    """Clear all stored subscriptions. To clear individual, use 'logout'"""
    profile = Profile(cli_ctx=cmd.cli_ctx)
    profile.logout_all()
Esempio n. 5
0
def account_clear():
    """Clear all stored subscriptions. To clear individual, use 'logout'"""
    profile = Profile()
    profile.logout_all()
Esempio n. 6
0
def account_clear():
    """Clear all stored subscriptions. To clear individual, use 'logout'"""
    profile = Profile()
    profile.logout_all()
Esempio n. 7
0
def account_clear():
    '''Clear all stored subscriptions. To clear individual, use \'logout\''''
    profile = Profile()
    profile.logout_all()
Esempio n. 8
0
def account_clear(cmd):
    """Clear all stored subscriptions. To clear individual, use 'logout'"""
    if in_cloud_console():
        logger.warning(_CLOUD_CONSOLE_LOGOUT_WARNING)
    profile = Profile(cli_ctx=cmd.cli_ctx)
    profile.logout_all()
Esempio n. 9
0
def account_clear():
    '''Clear all stored subscriptions. To clear individual, use \'logout\''''
    profile = Profile()
    profile.logout_all()